pub trait AsyncWriteAncillaryZerocopy {
type BufferReadyFuture<T: IoBuf, C: IoBuf>: Future<Output = (T, C)>;
type VectoredBufferReadyFuture<T: IoVectoredBuf, C: IoBuf>: Future<Output = (T, C)>;
// Required methods
fn write_zerocopy_with_ancillary<T, C>(
&mut self,
buf: T,
control: C,
) -> impl Future<Output = BufResult<usize, Self::BufferReadyFuture<T, C>>>
where T: IoBuf,
C: IoBuf;
fn write_zerocopy_vectored_with_ancillary<T, C>(
&mut self,
buf: T,
control: C,
) -> impl Future<Output = BufResult<usize, Self::VectoredBufferReadyFuture<T, C>>>
where T: IoVectoredBuf,
C: IoBuf;
}io and ancillary only.Expand description
Trait for zerocopy asynchronous write with ancillary (control) data. Intended for connected stream sockets (TCP, Unix streams) where no destination address is needed.
Required Associated Types§
Sourcetype BufferReadyFuture<T: IoBuf, C: IoBuf>: Future<Output = (T, C)>
type BufferReadyFuture<T: IoBuf, C: IoBuf>: Future<Output = (T, C)>
The future that will be resolved when the buffer is safe to be reused.
Sourcetype VectoredBufferReadyFuture<T: IoVectoredBuf, C: IoBuf>: Future<Output = (T, C)>
type VectoredBufferReadyFuture<T: IoVectoredBuf, C: IoBuf>: Future<Output = (T, C)>
The future that will be resolved when the vectored buffer is safe to be reused.
Required Methods§
Sourcefn write_zerocopy_with_ancillary<T, C>(
&mut self,
buf: T,
control: C,
) -> impl Future<Output = BufResult<usize, Self::BufferReadyFuture<T, C>>>
fn write_zerocopy_with_ancillary<T, C>( &mut self, buf: T, control: C, ) -> impl Future<Output = BufResult<usize, Self::BufferReadyFuture<T, C>>>
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_with_ancillary<T, C>(
&mut self,
buf: T,
control: C,
) -> impl Future<Output = BufResult<usize, Self::VectoredBufferReadyFuture<T, C>>>where
T: IoVectoredBuf,
C: IoBuf,
fn write_zerocopy_vectored_with_ancillary<T, C>(
&mut self,
buf: T,
control: C,
) -> impl Future<Output = BufResult<usize, Self::VectoredBufferReadyFuture<T, C>>>where
T: IoVectoredBuf,
C: IoBuf,
Like write_zerocopy_with_ancillary, 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.