Skip to main content

ByteHandles

Trait ByteHandles 

Source
pub trait ByteHandles {
    type Error: From<Error>;

    // Required methods
    fn put(&mut self, bytes: Bytes) -> Result<u64, Self::Error>;
    fn take(&mut self, handle: u64) -> Result<Bytes, Self::Error>;
}
Expand description

The embedder’s byte store for the current invocation, which carries binary data between the guest and the host by handle.

Required Associated Types§

Source

type Error: From<Error>

The embedder’s error, which also represents this crate’s errors.

Required Methods§

Source

fn put(&mut self, bytes: Bytes) -> Result<u64, Self::Error>

Store bytes for the guest to take, returning their handle.

Source

fn take(&mut self, handle: u64) -> Result<Bytes, Self::Error>

Take the bytes the guest stored under handle.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§