pub trait OutputStream: Send + Sync {
    // Required methods
    fn as_any(&self) -> &dyn Any;
    fn writable<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided methods
    fn pollable_write(&self) -> Option<BorrowedFd<'_>> { ... }
    fn write<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        _buf: &'life1 [u8]
    ) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn write_vectored<'a, 'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        _bufs: &'life1 [IoSlice<'a>]
    ) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'a: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn is_write_vectored(&self) -> bool { ... }
    fn splice<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        src: &'life1 mut dyn InputStream,
        nelem: u64
    ) -> Pin<Box<dyn Future<Output = Result<(u64, bool), Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn write_zeroes<'life0, 'async_trait>(
        &'life0 mut self,
        nelem: u64
    ) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
}
Expand description

An output bytestream.

This is “pseudo” because the real streams will be a type in wit, and built into the wit bindings, and will support async and type parameters. This pseudo-stream abstraction is synchronous and only supports bytes.

Required Methods§

source

fn as_any(&self) -> &dyn Any

source

fn writable<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Test whether this stream is writable.

Provided Methods§

source

fn pollable_write(&self) -> Option<BorrowedFd<'_>>

If this stream is writing from a host file descriptor, return it so that it can be polled with a host poll.

source

fn write<'life0, 'life1, 'async_trait>( &'life0 mut self, _buf: &'life1 [u8] ) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Write bytes. On success, returns the number of bytes written.

source

fn write_vectored<'a, 'life0, 'life1, 'async_trait>( &'life0 mut self, _bufs: &'life1 [IoSlice<'a>] ) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + Send + 'async_trait>>where Self: 'async_trait, 'a: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Vectored-I/O form of write.

source

fn is_write_vectored(&self) -> bool

Test whether vectored I/O writes are known to be optimized in the underlying implementation.

source

fn splice<'life0, 'life1, 'async_trait>( &'life0 mut self, src: &'life1 mut dyn InputStream, nelem: u64 ) -> Pin<Box<dyn Future<Output = Result<(u64, bool), Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Transfer bytes directly from an input stream to an output stream.

source

fn write_zeroes<'life0, 'async_trait>( &'life0 mut self, nelem: u64 ) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Repeatedly write a byte to a stream.

Implementors§