pub struct EventStreams<EVT: Send + Sync + 'static> { /* private fields */ }Expand description
Main object which allows to send events and subscribe to them
Implementations§
Source§impl<EVT: Send + Sync + 'static> EventStreams<EVT>
impl<EVT: Send + Sync + 'static> EventStreams<EVT>
pub fn new() -> Self
Sourcepub fn post_event<EVTSRC: Into<Option<Arc<EventBox>>>>(
&self,
event: EVT,
source: EVTSRC,
)
pub fn post_event<EVTSRC: Into<Option<Arc<EventBox>>>>( &self, event: EVT, source: EVTSRC, )
Put event to streams and immediately return
Parameters:
event- event itselfsource- optional parameter with event which was the cause ofevent. See Dependent Events section for details
Sourcepub fn send_event<EVTSRC: Into<Option<Arc<EventBox>>>>(
&self,
event: EVT,
source: EVTSRC,
) -> SentEvent ⓘ
pub fn send_event<EVTSRC: Into<Option<Arc<EventBox>>>>( &self, event: EVT, source: EVTSRC, ) -> SentEvent ⓘ
Put event to streams and return future whcih blocks until event is handled by all subscribers
Parameters:
event- event itselfsource- optional parameter with event which was the cause ofevent. See Dependent Events section for details
pub fn create_event_stream(&self) -> EventStream<EVT>
Auto Trait Implementations§
impl<EVT> !Freeze for EventStreams<EVT>
impl<EVT> RefUnwindSafe for EventStreams<EVT>where
EVT: RefUnwindSafe,
impl<EVT> Send for EventStreams<EVT>
impl<EVT> Sync for EventStreams<EVT>
impl<EVT> Unpin for EventStreams<EVT>where
EVT: Unpin,
impl<EVT> UnwindSafe for EventStreams<EVT>where
EVT: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more