pub struct EventBroadcaster { /* private fields */ }Expand description
Event broadcaster for managing and broadcasting events
Implementations§
Source§impl EventBroadcaster
impl EventBroadcaster
Sourcepub async fn subscribe(&self, filter: EventFilter) -> Receiver<Event>
pub async fn subscribe(&self, filter: EventFilter) -> Receiver<Event>
Subscribe to events with a filter
Sourcepub async fn unsubscribe(&self, subscription_id: Uuid)
pub async fn unsubscribe(&self, subscription_id: Uuid)
Unsubscribe from events
Sourcepub async fn broadcast_task_event(
&self,
event_type: EventType,
_task_id: Uuid,
data: Option<Value>,
source: &str,
) -> Result<()>
pub async fn broadcast_task_event( &self, event_type: EventType, _task_id: Uuid, data: Option<Value>, source: &str, ) -> Result<()>
Sourcepub async fn broadcast_project_event(
&self,
event_type: EventType,
_project_id: Uuid,
data: Option<Value>,
source: &str,
) -> Result<()>
pub async fn broadcast_project_event( &self, event_type: EventType, _project_id: Uuid, data: Option<Value>, source: &str, ) -> Result<()>
Sourcepub async fn broadcast_area_event(
&self,
event_type: EventType,
_area_id: Uuid,
data: Option<Value>,
source: &str,
) -> Result<()>
pub async fn broadcast_area_event( &self, event_type: EventType, _area_id: Uuid, data: Option<Value>, source: &str, ) -> Result<()>
Sourcepub async fn broadcast_progress_event(
&self,
event_type: EventType,
_operation_id: Uuid,
data: Option<Value>,
source: &str,
) -> Result<()>
pub async fn broadcast_progress_event( &self, event_type: EventType, _operation_id: Uuid, data: Option<Value>, source: &str, ) -> Result<()>
Sourcepub async fn broadcast_progress_update(
&self,
update: ProgressUpdate,
source: &str,
) -> Result<()>
pub async fn broadcast_progress_update( &self, update: ProgressUpdate, source: &str, ) -> Result<()>
Sourcepub async fn subscription_count(&self) -> usize
pub async fn subscription_count(&self) -> usize
Get the number of active subscriptions
Sourcepub fn subscribe_all(&self) -> Receiver<Event>
pub fn subscribe_all(&self) -> Receiver<Event>
Get a receiver for all events (unfiltered)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for EventBroadcaster
impl !RefUnwindSafe for EventBroadcaster
impl Send for EventBroadcaster
impl Sync for EventBroadcaster
impl Unpin for EventBroadcaster
impl !UnwindSafe for EventBroadcaster
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more