pub trait FromBytes<'a>: Sized {
    // Required method
    fn from_bytes(data: &'a [u8]) -> Result<Self, Error>;
}
Expand description

FromBytes is used to define how a type should be decoded when working with Extism memory. It is used for plugin output and host function input.

Required Methods§

source

fn from_bytes(data: &'a [u8]) -> Result<Self, Error>

Decode a value from a slice of bytes

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<'a> FromBytes<'a> for &'a str

source§

fn from_bytes(data: &'a [u8]) -> Result<Self, Error>

source§

impl<'a> FromBytes<'a> for &'a [u8]

source§

fn from_bytes(data: &'a [u8]) -> Result<Self, Error>

source§

impl<'a, T: FromBytes<'a>> FromBytes<'a> for Option<T>

source§

fn from_bytes(data: &'a [u8]) -> Result<Self, Error>

source§

impl<'a, T: FromBytes<'a>> FromBytes<'a> for Cursor<T>

source§

fn from_bytes(data: &'a [u8]) -> Result<Self, Error>

Implementors§

source§

impl<'a, T: Pod> FromBytes<'a> for Raw<'a, T>

source§

impl<'a, T: FromBytesOwned> FromBytes<'a> for T