pub struct EventStream { /* private fields */ }Implementations§
Source§impl EventStream
impl EventStream
pub fn new() -> Self
pub fn subscribe<T: Any + Send + Sync>( &self, f: impl Fn(&T) + Send + Sync + 'static, ) -> Subscription
Sourcepub fn subscribe_filtered<T, P>(
&self,
pred: P,
f: impl Fn(&T) + Send + Sync + 'static,
) -> Subscription
pub fn subscribe_filtered<T, P>( &self, pred: P, f: impl Fn(&T) + Send + Sync + 'static, ) -> Subscription
Subscribe with a predicate filter — only events matching
pred(t) are delivered to f. Phase 3.5 of
docs/full-port-plan.md.
EventStream.Subscribe(IActorRef, predicate) analog.
Sourcepub fn subscriber_count<T: Any>(&self) -> usize
pub fn subscriber_count<T: Any>(&self) -> usize
Number of subscribers registered for events of type T.
pub fn publish<T: Any + Send + Sync>(&self, value: T)
Trait Implementations§
Source§impl Default for EventStream
impl Default for EventStream
Source§fn default() -> EventStream
fn default() -> EventStream
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for EventStream
impl !RefUnwindSafe for EventStream
impl Send for EventStream
impl Sync for EventStream
impl Unpin for EventStream
impl UnsafeUnpin for EventStream
impl !UnwindSafe for EventStream
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