pub fn str<'s>(&self, ctx: &VmContext, len: Size) -> WasmResult<&'s str> {
        let len = len as usize;
        self.get_ptr_and_verify(ctx, len)
            .map(|p| unsafe { slice::from_raw_parts(p, len) })
            .and_then(|p| core::str::from_utf8(p).map_err(|_| Errno::Inval))
    }
/// Gets a string from a Wasm pointer, does checks for valid UTF-8 string.
/// Returns Ok(str) on success and Err(Errno) on fail.
Gets a string from a Wasm pointer, does checks for valid UTF-8 string.
Gets a string from a Wasm pointer does checks for valid UTF - 8 string .
pub fn str<'s>(&self, ctx: &VmContext, len: Size) -> WasmResult<&'s str> {
        let len = len as usize;
        self.get_ptr_and_verify(ctx, len)
            .map(|p| unsafe { slice::from_raw_parts(p, len) })
            .and_then(|p| core::str::from_utf8(p).map_err(|_| Errno::Inval))
    }
pub fn str < ' s > ( & self , ctx : & VmContext , len : Size ) -> WasmResult < & ' s str > { let len = len as usize ; self . get_ptr_and_verify ( ctx , len ) . map ( | p | unsafe { slice :: from_raw_parts ( p , len ) } ) . and_then ( | p | core :: str :: from_utf8 ( p ) . map_err ( | _ | Errno :: Inval ) ) }
Gets a string from a Wasm pointer, does checks for valid UTF-8 string.
Gets a string from a Wasm pointer does checks for valid UTF - 8 string .
&self
ctx
&VmContext
len
Size
&self
ctx
&VmContext
len
Size