[][src]Trait wasihost::StringRepresentation

pub trait StringRepresentation: 'static + Send + Sync + Deref {
    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 OsString[src]

impl StringRepresentation for CString[src]

impl StringRepresentation for Vec<u8>[src]

Loading content...

Implementors

Loading content...