Struct multi_consumer_stream::MCSHandle [] [src]

pub struct MCSHandle<S: Stream, Key: Eq + Hash + Copy, ItemFn, ErrFn> { /* fields omitted */ }

A stream that receives all items/errors for which the corresponding MCS's item_fn/err_fn return the key from which the MCSHandle was constructed.

Methods

impl<S, Key, ItemFn, ErrFn> MCSHandle<S, Key, ItemFn, ErrFn> where
    S: Stream,
    Key: Eq + Hash + Copy
[src]

[src]

Create a MCSHandle to the underlying stream. The handle receives all items for which the corresponding MCS's item_fn returns key, and all errors for which the MCS's error_fn returns key.

Panics if there is already a handle for that key.

[src]

Create a MCSHandle to the underlying stream. The handle receives all items for which the corresponding MCS's item_fn returns key, and all errors for which the MCS's error_fn returns key.

This returns None if there is already a handle for that key.

Trait Implementations

impl<S, Key, ItemFn, ErrFn> Drop for MCSHandle<S, Key, ItemFn, ErrFn> where
    S: Stream,
    Key: Eq + Hash + Copy
[src]

[src]

Deregisters the key of this KeyMCS.

impl<S, Key, ItemFn, ErrFn> Stream for MCSHandle<S, Key, ItemFn, ErrFn> where
    S: Stream,
    Key: Eq + Hash + Copy,
    ItemFn: Fn(&S::Item) -> Key,
    ErrFn: Fn(&S::Error) -> Key, 
[src]

Values yielded by the stream.

Errors yielded by the stream.

[src]

Attempt to pull out the next value of this stream, registering the current task for wakeup if the value is not yet available, and returning None if the stream is exhausted. Read more

Auto Trait Implementations

impl<S, Key, ItemFn, ErrFn> !Send for MCSHandle<S, Key, ItemFn, ErrFn>

impl<S, Key, ItemFn, ErrFn> !Sync for MCSHandle<S, Key, ItemFn, ErrFn>