Skip to main content

AsyncWriteZerocopy

Trait AsyncWriteZerocopy 

Source
pub trait AsyncWriteZerocopy {
    type BufferReadyFuture<T: IoBuf>: Future<Output = T>;
    type VectoredBufferReadyFuture<T: IoVectoredBuf>: Future<Output = T>;

    // Required methods
    fn write_zerocopy<T>(
        &mut self,
        buf: T,
    ) -> impl Future<Output = BufResult<usize, Self::BufferReadyFuture<T>>>
       where T: IoBuf;
    fn write_zerocopy_vectored<T>(
        &mut self,
        buf: T,
    ) -> impl Future<Output = BufResult<usize, Self::VectoredBufferReadyFuture<T>>>
       where T: IoVectoredBuf;
}
Available on crate feature io only.
Expand description

§AsyncZeroCopyWrite

Async zerocopy write with ownership of a buffer.

Required Associated Types§

Source

type BufferReadyFuture<T: IoBuf>: Future<Output = T>

The future that will be resolved when the buffer is safe to be reused.

Source

type VectoredBufferReadyFuture<T: IoVectoredBuf>: Future<Output = T>

The future that will be resolved when the vectored buffer is safe to be reused.

Required Methods§

Source

fn write_zerocopy<T>( &mut self, buf: T, ) -> impl Future<Output = BufResult<usize, Self::BufferReadyFuture<T>>>
where T: IoBuf,

Write some bytes from buffer into this source using the underlying zero-copy mechanism. It returns a result of the underlying write operation and a future that will be resolved when the buffer is safe to be reused.

Source

fn write_zerocopy_vectored<T>( &mut self, buf: T, ) -> impl Future<Output = BufResult<usize, Self::VectoredBufferReadyFuture<T>>>
where T: IoVectoredBuf,

Like write_zerocopy, except that it writes from a buffer implements IoVectoredBuf into the source.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<A> AsyncWriteZerocopy for &mut A

Implementors§