[][src]Struct stream_cancel::Valved

pub struct Valved<S>(_);

A Valved is wrapper around a Stream that enables the stream to be turned off remotely to initiate a graceful shutdown. When a new Valved is created with Valved::new, a handle to that Valved is also produced; when [Trigger::close] is called on that handle, the wrapped stream will immediately yield None to indicate that it has completed.

Methods

impl<S> Valved<S>[src]

pub fn new(stream: S) -> (Trigger, Self) where
    S: Stream
[src]

Make the given stream cancellable.

To cancel the stream, call [Trigger::close] on the returned handle.

Trait Implementations

impl<S: Clone> Clone for Valved<S>[src]

impl<S: Debug> Debug for Valved<S>[src]

impl<S> Stream for Valved<S> where
    S: Stream
[src]

type Item = S::Item

Values yielded by the stream.

Auto Trait Implementations

impl<S> !RefUnwindSafe for Valved<S>

impl<S> Send for Valved<S> where
    S: Send

impl<S> Sync for Valved<S> where
    S: Sync

impl<S> Unpin for Valved<S> where
    S: Unpin

impl<S> !UnwindSafe for Valved<S>

Blanket Implementations

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

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

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

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

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

impl<St> StreamExt for St where
    St: Stream + ?Sized
[src]

impl<T> StreamExt for T where
    T: Stream + ?Sized
[src]

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

type Owned = T

The resulting type after obtaining ownership.

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> 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<S, T, E> TryStream for S where
    S: Stream<Item = Result<T, E>> + ?Sized
[src]

type Ok = T

The type of successful values yielded by this future

type Error = E

The type of failures yielded by this future

impl<S> TryStreamExt for S where
    S: TryStream + ?Sized
[src]