[−][src]Struct frappe::stream::Sink
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]
T: 'a,
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]
I: IntoIterator<Item = U>,
U: Into<MaybeOwned<'a, T>>,
T: 'a,
Sends multiple values into the sink.
pub fn send_parallel(&self, val: &T) where
T: Sync,
[src]
T: Sync,
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]
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
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,