Struct wasmtime_wasi::preview2::pipe::AsyncWriteStream
source · pub struct AsyncWriteStream { /* private fields */ }
Expand description
Provides a HostOutputStream
impl from a tokio::io::AsyncWrite
impl
Implementations§
source§impl AsyncWriteStream
impl AsyncWriteStream
sourcepub fn new<T: AsyncWrite + Send + Sync + Unpin + 'static>(writer: T) -> Self
pub fn new<T: AsyncWrite + Send + Sync + Unpin + 'static>(writer: T) -> Self
Create a AsyncWriteStream
. In order to use the HostOutputStream
impl
provided by this struct, the argument must impl tokio::io::AsyncWrite
.
Trait Implementations§
source§impl Drop for AsyncWriteStream
impl Drop for AsyncWriteStream
source§impl HostOutputStream for AsyncWriteStream
impl HostOutputStream for AsyncWriteStream
source§fn write(&mut self, bytes: Bytes) -> Result<(usize, StreamState), Error>
fn write(&mut self, bytes: Bytes) -> Result<(usize, StreamState), Error>
Write bytes. On success, returns the number of bytes written.
Important: this write must be non-blocking!
source§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,
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,
Check for write readiness: this method blocks until the stream is
ready for writing.
source§fn 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!
source§fn 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!
Auto Trait Implementations§
impl !RefUnwindSafe for AsyncWriteStream
impl Send for AsyncWriteStream
impl Sync for AsyncWriteStream
impl Unpin for AsyncWriteStream
impl !UnwindSafe for AsyncWriteStream
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
source§impl<T> GetSetFdFlags for T
impl<T> GetSetFdFlags for T
source§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.source§fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where T: AsFilelike,
source§fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where T: AsFilelike,
Set the “status” flags for the
self
file descriptor. Read more