pub fn spawn(&'a self, fn_name: &str) -> ExecResult<'a, Process<'a>> {
        let entry_func_idx = match self
            .exports
            .iter()
            .filter_map(|e| match &e.desc {
                section::ExportDesc::Function(idx) => Some((idx, e.name)),
                _ => None,
            })
            .find(|(_, name)| *name == fn_name)
        {
            Some((idx, _)) => idx,
            None => {
                return Err(ExecError {
                    wasm: self,
                    kind: ExecErrorKind::FunctionNotFound,
                })
            }
        };

        Ok(Process::new(self, *entry_func_idx))
    }
/// Spawn a new process that starts at the given `fn_name` entrypoint.
///
/// Implementations should make sure that the given `fn_name` is publicly available. In rust this is done by marking it as:
/// ```rs
/// #[no_mangle]
/// pub extern "C" fn fn_name() { .. }
/// ```
Spawn a new process that starts at the given `fn_name` entrypoint.
Implementations should make sure that the given `fn_name` is publicly available. In rust this is done by marking it as:
```rs
Spawn a new process that starts at the given ` fn_name ` entrypoint . Implementations should make sure that the given ` fn_name ` is publicly available . In rust this is done by marking it as : ` ` ` rs
pub fn spawn(&'a self, fn_name: &str) -> ExecResult<'a, Process<'a>> {
        let entry_func_idx = match self
            .exports
            .iter()
            .filter_map(|e| match &e.desc {
                section::ExportDesc::Function(idx) => Some((idx, e.name)),
                _ => None,
            })
            .find(|(_, name)| *name == fn_name)
        {
            Some((idx, _)) => idx,
            None => {
                return Err(ExecError {
                    wasm: self,
                    kind: ExecErrorKind::FunctionNotFound,
                })
            }
        };
        Ok(Process::new(self, *entry_func_idx))
    }
pub fn spawn ( & ' a self , fn_name : & str ) -> ExecResult < ' a , Process < ' a > > { let entry_func_idx = match self . exports . iter ( ) . filter_map ( | e | match & e . desc { section :: ExportDesc :: Function ( idx ) => Some ( ( idx , e . name ) ) , _ => None , } ) . find ( | ( _ , name ) | * name == fn_name ) { Some ( ( idx , _ ) ) => idx , None => { return Err ( ExecError { wasm : self , kind : ExecErrorKind :: FunctionNotFound , } ) } } ; Ok ( Process :: new ( self , * entry_func_idx ) ) }
Spawn a new process that starts at the given `fn_name` entrypoint.
Spawn a new process that starts at the given ` fn_name ` entrypoint .
&'a self
fn_name
&str
&'a self
fn_name
&str
[no_mangle]
pub extern "C" fn fn_name() { ..
pub extern " C " fn fn_name () { ..