pub trait AsyncWriteZerocopy {
type BufferReadyFuture<T: IoBuf>: Future<Output = T>;
type VectoredBufferReadyFuture<T: IoVectoredBuf>: Future<Output = T>;
// Required methods
fn write_zerocopy<T: IoBuf>(
&mut self,
buf: T,
) -> impl Future<Output = BufResult<usize, Self::BufferReadyFuture<T>>>;
fn write_zerocopy_vectored<T: IoVectoredBuf>(
&mut self,
buf: T,
) -> impl Future<Output = BufResult<usize, Self::VectoredBufferReadyFuture<T>>>;
}Expand description
§AsyncZeroCopyWrite
Async zerocopy write with ownership of a buffer.
Required Associated Types§
Sourcetype BufferReadyFuture<T: IoBuf>: Future<Output = T>
type BufferReadyFuture<T: IoBuf>: Future<Output = T>
The future that will be resolved when the buffer is safe to be reused.
Sourcetype VectoredBufferReadyFuture<T: IoVectoredBuf>: Future<Output = T>
type VectoredBufferReadyFuture<T: IoVectoredBuf>: Future<Output = T>
The future that will be resolved when the vectored buffer is safe to be reused.
Required Methods§
Sourcefn write_zerocopy<T: IoBuf>(
&mut self,
buf: T,
) -> impl Future<Output = BufResult<usize, Self::BufferReadyFuture<T>>>
fn write_zerocopy<T: IoBuf>( &mut self, buf: T, ) -> impl Future<Output = BufResult<usize, Self::BufferReadyFuture<T>>>
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.
Sourcefn write_zerocopy_vectored<T: IoVectoredBuf>(
&mut self,
buf: T,
) -> impl Future<Output = BufResult<usize, Self::VectoredBufferReadyFuture<T>>>
fn write_zerocopy_vectored<T: IoVectoredBuf>( &mut self, buf: T, ) -> impl Future<Output = BufResult<usize, Self::VectoredBufferReadyFuture<T>>>
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".