pub struct PreemptionSimulator {
pub time_slice: u64,
pub ticks_used: u64,
pub preemptions: u64,
pub active_task: Option<TaskId>,
}Expand description
Simulates preemptive scheduling by tracking time slices.
Fields§
§time_slice: u64Time slice in ticks per task before forced preemption.
ticks_used: u64Current tick within the slice for the active task.
preemptions: u64Total preemptions performed.
active_task: Option<TaskId>Currently active task.
Implementations§
Source§impl PreemptionSimulator
impl PreemptionSimulator
Sourcepub fn set_active(&mut self, id: TaskId)
pub fn set_active(&mut self, id: TaskId)
Assign the active task.
Trait Implementations§
Source§impl Clone for PreemptionSimulator
impl Clone for PreemptionSimulator
Source§fn clone(&self) -> PreemptionSimulator
fn clone(&self) -> PreemptionSimulator
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 moreAuto Trait Implementations§
impl Freeze for PreemptionSimulator
impl RefUnwindSafe for PreemptionSimulator
impl Send for PreemptionSimulator
impl Sync for PreemptionSimulator
impl Unpin for PreemptionSimulator
impl UnsafeUnpin for PreemptionSimulator
impl UnwindSafe for PreemptionSimulator
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