[][src]Struct futures::sink::With

#[must_use = "sinks do nothing unless polled"]
pub struct With<S, U, F, Fut> where
    S: Sink,
    F: FnMut(U) -> Fut,
    Fut: IntoFuture
{ /* fields omitted */ }

Sink for the Sink::with combinator, chaining a computation to run prior to pushing a value into the underlying sink.

Methods

impl<S, U, F, Fut> With<S, U, F, Fut> where
    S: Sink,
    F: FnMut(U) -> Fut,
    Fut: IntoFuture<Item = S::SinkItem>,
    Fut::Error: From<S::SinkError>, 
[src]

pub fn get_ref(&self) -> &S[src]

Get a shared reference to the inner sink.

pub fn get_mut(&mut self) -> &mut S[src]

Get a mutable reference to the inner sink.

pub fn into_inner(self) -> S[src]

Consumes this combinator, returning the underlying sink.

Note that this may discard intermediate state of this combinator, so care should be taken to avoid losing resources when this is called.

Trait Implementations

impl<S, U, F, Fut> Stream for With<S, U, F, Fut> where
    S: Stream + Sink,
    F: FnMut(U) -> Fut,
    Fut: IntoFuture
[src]

type Item = S::Item

The type of item this stream will yield on success.

type Error = S::Error

The type of error this stream may generate.

impl<S, U, F, Fut> Sink for With<S, U, F, Fut> where
    S: Sink,
    F: FnMut(U) -> Fut,
    Fut: IntoFuture<Item = S::SinkItem>,
    Fut::Error: From<S::SinkError>, 
[src]

type SinkItem = U

The type of value that the sink accepts.

type SinkError = Fut::Error

The type of value produced by the sink when an error occurs.

impl<S: Debug, U: Debug, F: Debug, Fut: Debug> Debug for With<S, U, F, Fut> where
    S: Sink,
    F: FnMut(U) -> Fut,
    Fut: IntoFuture,
    Fut::Future: Debug,
    S::SinkItem: Debug
[src]

impl<S: Clone, U: Clone, F: Clone, Fut: Clone> Clone for With<S, U, F, Fut> where
    S: Sink,
    F: FnMut(U) -> Fut,
    Fut: IntoFuture,
    Fut::Future: Clone,
    S::SinkItem: Clone
[src]

Auto Trait Implementations

impl<S, U, F, Fut> Unpin for With<S, U, F, Fut> where
    F: Unpin,
    S: Unpin,
    <Fut as IntoFuture>::Future: Unpin,
    <S as Sink>::SinkItem: Unpin

impl<S, U, F, Fut> Send for With<S, U, F, Fut> where
    F: Send,
    S: Send,
    <Fut as IntoFuture>::Future: Send,
    <S as Sink>::SinkItem: Send

impl<S, U, F, Fut> Sync for With<S, U, F, Fut> where
    F: Sync,
    S: Sync,
    <Fut as IntoFuture>::Future: Sync,
    <S as Sink>::SinkItem: Sync

impl<S, U, F, Fut> UnwindSafe for With<S, U, F, Fut> where
    F: UnwindSafe,
    S: UnwindSafe,
    <Fut as IntoFuture>::Future: UnwindSafe,
    <S as Sink>::SinkItem: UnwindSafe

impl<S, U, F, Fut> RefUnwindSafe for With<S, U, F, Fut> where
    F: RefUnwindSafe,
    S: RefUnwindSafe,
    <Fut as IntoFuture>::Future: RefUnwindSafe,
    <S as Sink>::SinkItem: RefUnwindSafe

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.