Struct relm_state::EventStream
[−]
[src]
pub struct EventStream<MSG> { /* fields omitted */ }
A stream of messages to be used for widget/signal communication and inter-widget communication.
Methods
impl<MSG> EventStream<MSG>
[src]
pub fn new() -> EventStream<MSG>
[src]
Create a new event stream.
pub fn close(&self)
[src]
Close the event stream, i.e. stop processing messages.
pub fn emit(&self, event: MSG)
[src]
Send the event
message to the stream and the observers.
pub fn lock(&self) -> Lock<MSG>
[src]
Lock the stream (don't emit message) until the Lock
goes out of scope.
pub fn observe<CALLBACK>(&self, callback: CALLBACK) where
CALLBACK: 'static + Fn(&MSG),
[src]
CALLBACK: 'static + Fn(&MSG),
Add an observer to the event stream. This callback will be called every time a message is emmited.
pub fn set_callback<CALLBACK>(&self, callback: CALLBACK) where
CALLBACK: 'static + FnMut(MSG),
[src]
CALLBACK: 'static + FnMut(MSG),
Add a callback to the event stream. This is the main callback and received a owned version of the message, in contrast to observe().
Trait Implementations
impl<MSG> Clone for EventStream<MSG>
[src]
fn clone(&self) -> EventStream<MSG>
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl<MSG> Send for EventStream<MSG> where
MSG: Send,
MSG: Send,
impl<MSG> Sync for EventStream<MSG> where
MSG: Sync,
MSG: Sync,