pub trait Sink:
Index
+ Send
+ 'static {
// Required methods
fn write_future<T>(
self,
offset: usize,
item: impl Future<Output = T> + Send + 'static,
) -> impl Future<Output = Result<()>> + Send
where T: Encode<Self>,
Error: From<<T::Encoder as Encoder<T>>::Error>;
fn write_stream<T>(
self,
offset: usize,
items: impl Stream<Item = Vec<T>> + Send + Unpin + 'static,
) -> impl Future<Output = Result<()>> + Send
where T: Encode<Self> + Send + 'static,
Error: From<<T::Encoder as Encoder<T>>::Error>;
fn write_stream_bytes(
self,
offset: usize,
items: impl Stream<Item = Bytes> + Send + Unpin + 'static,
) -> impl Future<Output = Result<()>> + Send;
fn write_stream_read(
self,
offset: usize,
ready: BytesMut,
items: impl AsyncRead + Send + Unpin + 'static,
) -> impl Future<Output = Result<()>> + Send;
}Expand description
Target of deferred transmission of asynchronous values, encoded by Encode
offset is the position of the byte written by the encoder of the asynchronous value
in the buffer the value was encoded into.
Required Methods§
Sourcefn write_future<T>(
self,
offset: usize,
item: impl Future<Output = T> + Send + 'static,
) -> impl Future<Output = Result<()>> + Send
fn write_future<T>( self, offset: usize, item: impl Future<Output = T> + Send + 'static, ) -> impl Future<Output = Result<()>> + Send
Transmits the value of a future<T>
Sourcefn write_stream<T>(
self,
offset: usize,
items: impl Stream<Item = Vec<T>> + Send + Unpin + 'static,
) -> impl Future<Output = Result<()>> + Send
fn write_stream<T>( self, offset: usize, items: impl Stream<Item = Vec<T>> + Send + Unpin + 'static, ) -> impl Future<Output = Result<()>> + Send
Transmits the elements of a stream<T>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".