Trait tor_async_utils::SinkExt

source ·
pub trait SinkExt<Item>: Sink<Item> {
    // Required method
    fn with_fn<F, T, E>(self, func: F) -> WithFn<Self, F, T, E>
       where Self: Sized,
             F: FnMut(T) -> Result<Item, E>,
             E: From<Self::Error>;
}
Expand description

Extension trait for Sink

Required Methods§

source

fn with_fn<F, T, E>(self, func: F) -> WithFn<Self, F, T, E>
where Self: Sized, F: FnMut(T) -> Result<Item, E>, E: From<Self::Error>,

As Sink::with, but takes a function that returns an Item rather than Future<Output=Item>.

Implementors§

source§

impl<Item, S> SinkExt<Item> for S
where S: Sink<Item>,