pub trait QueueEventEmitter:
Send
+ Sync
+ 'static {
// Required methods
fn emit_job_started(&self, event: JobStartedEvent);
fn emit_job_completed(&self, event: JobCompletedEvent);
fn emit_job_failed(&self, event: JobFailedEvent);
fn emit_job_progress(&self, event: JobProgressEvent);
fn emit_job_cancelled(&self, event: JobCancelledEvent);
}Expand description
Trait for emitting queue lifecycle events.
Implement this trait to receive notifications about job state changes. For example, a Tauri app would implement this to emit events to the frontend, while a CLI app might log to stdout or update a progress bar.
Required Methods§
Sourcefn emit_job_started(&self, event: JobStartedEvent)
fn emit_job_started(&self, event: JobStartedEvent)
Called when a job starts executing.
Sourcefn emit_job_completed(&self, event: JobCompletedEvent)
fn emit_job_completed(&self, event: JobCompletedEvent)
Called when a job completes successfully.
Sourcefn emit_job_failed(&self, event: JobFailedEvent)
fn emit_job_failed(&self, event: JobFailedEvent)
Called when a job fails.
Sourcefn emit_job_progress(&self, event: JobProgressEvent)
fn emit_job_progress(&self, event: JobProgressEvent)
Called when a job reports progress.
Sourcefn emit_job_cancelled(&self, event: JobCancelledEvent)
fn emit_job_cancelled(&self, event: JobCancelledEvent)
Called when a job is cancelled.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".