Trait wasmtime_wasi::preview2::HostOutputStream
source · pub trait HostOutputStream: Send + Sync {
// Required methods
fn write(&mut self, bytes: Bytes) -> Result<(usize, StreamState), Error>;
fn ready<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided methods
fn splice(
&mut self,
src: &mut dyn HostInputStream,
nelem: usize
) -> Result<(usize, StreamState), Error> { ... }
fn write_zeroes(
&mut self,
nelem: usize
) -> Result<(usize, StreamState), Error> { ... }
}
Expand description
Host trait for implementing the wasi:io/streams.output-stream
resource:
A bytestream which can be written to.
Required Methods§
Provided Methods§
sourcefn splice(
&mut self,
src: &mut dyn HostInputStream,
nelem: usize
) -> Result<(usize, StreamState), Error>
fn splice( &mut self, src: &mut dyn HostInputStream, nelem: usize ) -> Result<(usize, StreamState), Error>
Transfer bytes directly from an input stream to an output stream. Important: this splice must be non-blocking!
sourcefn write_zeroes(&mut self, nelem: usize) -> Result<(usize, StreamState), Error>
fn write_zeroes(&mut self, nelem: usize) -> Result<(usize, StreamState), Error>
Repeatedly write a byte to a stream. Important: this write must be non-blocking!