[][src]Struct futures::sink::WithFlatMap

#[must_use = "sinks do nothing unless polled"]
pub struct WithFlatMap<S, U, F, St> where
    S: Sink,
    F: FnMut(U) -> St,
    St: Stream<Item = S::SinkItem, Error = S::SinkError>, 
{ /* fields omitted */ }

Sink for the Sink::with_flat_map combinator, chaining a computation that returns an iterator to run prior to pushing a value into the underlying sink

Methods

impl<S, U, F, St> WithFlatMap<S, U, F, St> where
    S: Sink,
    F: FnMut(U) -> St,
    St: Stream<Item = S::SinkItem, Error = 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, St> Stream for WithFlatMap<S, U, F, St> where
    S: Stream + Sink,
    F: FnMut(U) -> St,
    St: Stream<Item = S::SinkItem, Error = S::SinkError>, 
[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, St> Sink for WithFlatMap<S, U, F, St> where
    S: Sink,
    F: FnMut(U) -> St,
    St: Stream<Item = S::SinkItem, Error = S::SinkError>, 
[src]

type SinkItem = U

The type of value that the sink accepts.

type SinkError = S::SinkError

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

impl<S: Debug, U: Debug, F: Debug, St: Debug> Debug for WithFlatMap<S, U, F, St> where
    S: Sink,
    F: FnMut(U) -> St,
    St: Stream<Item = S::SinkItem, Error = S::SinkError>,
    S::SinkItem: Debug
[src]

Auto Trait Implementations

impl<S, U, F, St> Unpin for WithFlatMap<S, U, F, St> where
    F: Unpin,
    S: Unpin,
    St: Unpin,
    <S as Sink>::SinkItem: Unpin

impl<S, U, F, St> Send for WithFlatMap<S, U, F, St> where
    F: Send,
    S: Send,
    St: Send,
    <S as Sink>::SinkItem: Send

impl<S, U, F, St> Sync for WithFlatMap<S, U, F, St> where
    F: Sync,
    S: Sync,
    St: Sync,
    <S as Sink>::SinkItem: Sync

impl<S, U, F, St> UnwindSafe for WithFlatMap<S, U, F, St> where
    F: UnwindSafe,
    S: UnwindSafe,
    St: UnwindSafe,
    <S as Sink>::SinkItem: UnwindSafe

impl<S, U, F, St> RefUnwindSafe for WithFlatMap<S, U, F, St> where
    F: RefUnwindSafe,
    S: RefUnwindSafe,
    St: 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]