[][src]Trait wasihost_core::StringRepresentation

pub trait StringRepresentation: Deref + Sized + Send + Sync + 'static {
    fn from_bytes(bytes: Vec<u8>) -> Result<Self, ()>;
fn as_bytes(&self) -> &[u8]; }

A string representation for the WASI high level APIs.

Required methods

fn from_bytes(bytes: Vec<u8>) -> Result<Self, ()>

Tries to convert a vector of owned bytes into a string. If the conversion fails, the WASI method that attempted the conversion will return errno_inval.

fn as_bytes(&self) -> &[u8]

Converts a string into a byte slice.

Loading content...

Implementations on Foreign Types

impl StringRepresentation for String[src]

impl StringRepresentation for Vec<u8>[src]

impl StringRepresentation for OsString[src]

impl StringRepresentation for CString[src]

Loading content...

Implementors

Loading content...