pub enum TaskEvent {
Spawn {
task_id: u64,
priority: u8,
name: Option<String>,
},
Start {
task_id: u64,
},
Yield {
task_id: u64,
},
Wakeup {
task_id: u64,
reason: WakeupReason,
},
Complete {
task_id: u64,
},
Failed {
task_id: u64,
error: String,
},
Cancelled {
task_id: u64,
reason: CancelReason,
},
PolicyChange {
from: SchedulerPolicy,
to: SchedulerPolicy,
},
QueueSnapshot {
queued: usize,
running: usize,
},
Custom {
tag: String,
data: String,
},
}Expand description
A scheduler event with deterministic ordering.
Variants§
Spawn
Task spawned into the queue.
Start
Task started execution.
Yield
Task yielded voluntarily.
Wakeup
Task woken up (external trigger).
Complete
Task completed successfully.
Failed
Task failed with error.
Cancelled
Task cancelled.
PolicyChange
Scheduler policy changed.
QueueSnapshot
Queue state snapshot (for debugging).
Custom
Custom event for extensibility.
Trait Implementations§
impl StructuralPartialEq for TaskEvent
Auto Trait Implementations§
impl Freeze for TaskEvent
impl RefUnwindSafe for TaskEvent
impl Send for TaskEvent
impl Sync for TaskEvent
impl Unpin for TaskEvent
impl UnsafeUnpin for TaskEvent
impl UnwindSafe for TaskEvent
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