Struct sodium_rust::StreamSink

source ·
pub struct StreamSink<A> {
    pub impl_: StreamSinkImpl<A>,
}
Expand description

A Stream that allows values to be pushed into it, acting as an interface between the world of I/O and the world of FRP.

Note: This should only be used from outside the context of

the Sodium system to inject data from I/O into the reactive system.

Fields§

§impl_: StreamSinkImpl<A>

Implementations§

Create a StreamSink that allows calling send on it once per transaction.

If you call send more than once in a transaction on a StreamSink constructed with StreamSink::new it will panic. If you need to do this then use StreamSink::new_with_coalescer.

Create a StreamSink that allows calling send one or more times per transaction.

If you call send on the returned StreamSink more than once in a single transaction the events will be combined into a single event using the specified combining function. The combining function should be associative.

Return a Stream that can be used in the creation of Sodium logic that will consume events pushed into this StreamSink from the I/O world.

Send a value to be made available to consumers of the Stream associated with this StreamSink.

This method may not be called in handlers registered with Stream::listen or Cell::listen.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.