pub trait Sink<Item> {
type Error;
// Required method
fn send(
&mut self,
value: Item,
) -> impl Future<Output = Result<(), Self::Error>>;
// Provided methods
fn with_map_err<F, U>(self, f: F) -> WithMapErr<Self, F>
where Self: Sized,
F: Fn(Self::Error) -> U + Send + 'static { ... }
fn with_map<F, U>(self, f: F) -> WithMap<Self, F>
where Self: Sized,
F: Fn(U) -> Item + Send + 'static { ... }
}
Expand description
Our version of a sink, that can be mapped etc.
Required Associated Types§
Required Methods§
Provided Methods§
fn with_map_err<F, U>(self, f: F) -> WithMapErr<Self, F>
fn with_map<F, U>(self, f: F) -> WithMap<Self, F>
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.