[][src]Struct frappe::stream::Sink

pub struct Sink<T> { /* fields omitted */ }

A source of events that feeds the streams connected to it.

Methods

impl<T> Sink<T>[src]

pub fn new() -> Self[src]

Creates a new sink.

pub fn stream(&self) -> Stream<T>[src]

Creates a stream that receives the events sent to this sink.

pub fn send<'a>(&self, val: impl Into<MaybeOwned<'a, T>>) where
    T: 'a, 
[src]

Sends a value into the sink.

The value will be distributed N-1 times as reference and then one time by value, where N is the amount of streams connected to this sink.

pub fn feed<'a, I, U>(&self, iter: I) where
    I: IntoIterator<Item = U>,
    U: Into<MaybeOwned<'a, T>>,
    T: 'a, 
[src]

Sends multiple values into the sink.

pub fn send_parallel(&self, val: &T) where
    T: Sync
[src]

Sends a value using multiple threads.

This method sends a value to each of the Sink's connected streams simultaneously by spawning a thread for each one, then it waits for all threads to finish. The value is sent by reference, so no cloning is done.

Trait Implementations

impl<T> Default for Sink<T>[src]

fn default() -> Self[src]

Creates a new sink.

impl<T> Clone for Sink<T>[src]

fn clone(&self) -> Self[src]

Creates a copy of this sink that references the same event source.

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl<T: Debug> Debug for Sink<T>[src]

Auto Trait Implementations

impl<T> Send for Sink<T>

impl<T> Sync for Sink<T>

Blanket Implementations

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

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

type Owned = T

impl<T> From for T[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

impl<T, U> TryInto 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> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Erased for T