pub struct EventManager {
pub event_callback: Option<Arc<Mutex<Box<dyn EventCallback + Send + Sync>>>>,
pub event_flags: EventType,
pub dry_run: bool,
pub pipeline_stats: Arc<Mutex<PipelineStats>>,
}Expand description
Manages event callback registration and dispatching.
Holds an optional EventCallback trait object and accumulated pipeline statistics.
On PIPELINE_END, sends a STATS_REPORT event with accumulated stats if the caller
subscribed to STATS_REPORT via event_flags.
Fields§
§event_callback: Option<Arc<Mutex<Box<dyn EventCallback + Send + Sync>>>>§event_flags: EventType§dry_run: bool§pipeline_stats: Arc<Mutex<PipelineStats>>Implementations§
Source§impl EventManager
impl EventManager
pub fn new() -> Self
Sourcepub fn register_callback<T: EventCallback + Send + Sync + 'static>(
&mut self,
events_flag: EventType,
callback: T,
dry_run: bool,
)
pub fn register_callback<T: EventCallback + Send + Sync + 'static>( &mut self, events_flag: EventType, callback: T, dry_run: bool, )
Register an event callback with event type filter and dry-run flag.
Sourcepub fn is_callback_registered(&self) -> bool
pub fn is_callback_registered(&self) -> bool
Returns true if an event callback has been registered.
Sourcepub async fn trigger_event(&self, event_data: EventData)
pub async fn trigger_event(&self, event_data: EventData)
Trigger an event, updating internal stats and dispatching to the callback.
Trait Implementations§
Source§impl Clone for EventManager
impl Clone for EventManager
Source§fn clone(&self) -> EventManager
fn clone(&self) -> EventManager
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EventManager
impl Debug for EventManager
Auto Trait Implementations§
impl Freeze for EventManager
impl !RefUnwindSafe for EventManager
impl Send for EventManager
impl Sync for EventManager
impl Unpin for EventManager
impl UnsafeUnpin for EventManager
impl !UnwindSafe for EventManager
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 moreCreates a shared type from an unshared type.