Struct wasmtime_wasi_http::body::BodyWriteStream
source · pub struct BodyWriteStream { /* private fields */ }
Expand description
Provides a HostOutputStream
impl from a tokio::sync::mpsc::Sender
.
Implementations§
Trait Implementations§
source§impl HostOutputStream for BodyWriteStream
impl HostOutputStream for BodyWriteStream
source§fn write(&mut self, bytes: Bytes) -> Result<(), StreamError>
fn write(&mut self, bytes: Bytes) -> Result<(), StreamError>
Write bytes after obtaining a permit to write those bytes Read more
source§fn flush(&mut self) -> Result<(), StreamError>
fn flush(&mut self) -> Result<(), StreamError>
Trigger a flush of any bytes buffered in this stream implementation. Read more
source§fn check_write(&mut self) -> Result<usize, StreamError>
fn check_write(&mut self) -> Result<usize, StreamError>
Returns the number of bytes that are ready to be written to this stream. Read more
source§fn write_zeroes(&mut self, nelem: usize) -> Result<(), StreamError>
fn write_zeroes(&mut self, nelem: usize) -> Result<(), StreamError>
Repeatedly write a byte to a stream.
Important: this write must be non-blocking!
Returning an Err which downcasts to a
StreamError
will be
reported to Wasm as the empty error result. Otherwise, errors will trap.source§fn write_ready<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<usize, StreamError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: Send + 'async_trait,
fn write_ready<'life0, 'async_trait>( &'life0 mut self ) -> Pin<Box<dyn Future<Output = Result<usize, StreamError>> + Send + 'async_trait>>where 'life0: 'async_trait, Self: Send + 'async_trait,
Simultaneously waits for this stream to be writable and then returns how
much may be written or the last error that happened.
Auto Trait Implementations§
impl RefUnwindSafe for BodyWriteStream
impl Send for BodyWriteStream
impl Sync for BodyWriteStream
impl Unpin for BodyWriteStream
impl UnwindSafe for BodyWriteStream
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> GetSetFdFlags for T
impl<T> GetSetFdFlags for T
§fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
fn get_fd_flags(&self) -> Result<FdFlags, Error>where T: AsFilelike,
Query the “status” flags for the
self
file descriptor.