Struct relm::EventStream [−][src]
A stream of messages to be used for widget/signal communication and inter-widget communication.
EventStream cannot be send to another thread. Use a Channel
Sender
instead.
Implementations
impl<MSG> EventStream<MSG>
[src]
pub fn new() -> Self
[src]
Create a new event stream.
pub fn close(&self)
[src]
Close the event stream, i.e. stop processing messages.
pub fn stream(&self) -> StreamHandle<MSG>
[src]
Synonym for downgrade().
pub fn downgrade(&self) -> StreamHandle<MSG>
[src]
Create a Clone-able EventStream handle.
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: Fn(&MSG) + 'static>(&self, callback: CALLBACK)
[src]
Add an observer to the event stream. This callback will be called every time a message is emmited.
pub fn set_callback<CALLBACK: FnMut(MSG) + 'static>(&self, callback: CALLBACK)
[src]
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> Drop for EventStream<MSG>
[src]
Auto Trait Implementations
impl<MSG> RefUnwindSafe for EventStream<MSG> where
MSG: RefUnwindSafe,
[src]
MSG: RefUnwindSafe,
impl<MSG> !Send for EventStream<MSG>
[src]
impl<MSG> !Sync for EventStream<MSG>
[src]
impl<MSG> Unpin for EventStream<MSG>
[src]
impl<MSG> UnwindSafe for EventStream<MSG> where
MSG: RefUnwindSafe,
[src]
MSG: RefUnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,