Skip to main content

Scheduling

Struct Scheduling 

Source
pub struct Scheduling<T>
where T: Trace,
{ /* private fields */ }
Expand description

A Trace that passes on only the events a schedule is made of.

§What this is for

Turning tickless idle on changes a trace, so a raw byte-diff against the C kernel’s cannot survive it – 15.2% of the conformance corpus is TASK_INCREMENT_TICK. But it does not change the SCHEDULE: a task still runs at the tick it would have run at, because the port winds the count forward across the sleep.

This is the projection that says so. Wrap any sink in it and the events that reach the sink are exactly the ones a correct tickless port must not disturb – so two runs that differ only in whether they slept produce the same output, and a run that reordered, dropped or added a scheduling decision does not.

It is a claim about what is being proved, so it is worth being narrow: is_suppressible names the three events dropped, and every other event – every switch, every list move, every queue and event-group and timer operation, with its tick stamp – goes through untouched.

use rusty_rtos_core::trace::{CountTrace, Event, Scheduling, Trace};

let mut projected = Scheduling::new(CountTrace::default());
projected.event(7, Event::TaskIncrementTick { tick: 7 });
projected.event(7, Event::StartingScheduler);
// The tick did not reach the sink; the scheduler start did.
assert_eq!(projected.into_inner().events, 1);

Implementations§

Source§

impl<T> Scheduling<T>
where T: Trace,

Source

pub const fn new(inner: T) -> Scheduling<T>

Project onto inner.

Source

pub fn into_inner(self) -> T

The sink back out, to read whatever it collected.

Source

pub const fn inner(&self) -> &T

The sink, borrowed.

Trait Implementations§

Source§

impl<T> Clone for Scheduling<T>
where T: Clone + Trace,

Source§

fn clone(&self) -> Scheduling<T>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T> Copy for Scheduling<T>
where T: Copy + Trace,

Source§

impl<T> Debug for Scheduling<T>
where T: Debug + Trace,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<T> Default for Scheduling<T>
where T: Default + Trace,

Source§

fn default() -> Scheduling<T>

Returns the “default value” for a type. Read more
Source§

impl<T> Eq for Scheduling<T>
where T: Eq + Trace,

Source§

impl<T> Hash for Scheduling<T>
where T: Hash + Trace,

Source§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<T> PartialEq for Scheduling<T>
where T: PartialEq + Trace,

Source§

fn eq(&self, other: &Scheduling<T>) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<T> StructuralPartialEq for Scheduling<T>
where T: PartialEq + Trace,

Source§

impl<T> Trace for Scheduling<T>
where T: Trace,

Source§

const WANTS_NAMES: bool = T::WANTS_NAMES

Whether this sink reads the name an event carries. Read more
Source§

fn note_exits(&mut self, exits: u64)

The port’s outermost critical-section exit count, as it stands at the moment of the next Trace::event. Read more
Source§

fn event(&mut self, tick: u64, event: Event<'_>)

An event, at the kernel’s current tick count.

Auto Trait Implementations§

§

impl<T> Freeze for Scheduling<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for Scheduling<T>
where T: RefUnwindSafe,

§

impl<T> Send for Scheduling<T>
where T: Send,

§

impl<T> Sync for Scheduling<T>
where T: Sync,

§

impl<T> Unpin for Scheduling<T>
where T: Unpin,

§

impl<T> UnsafeUnpin for Scheduling<T>
where T: UnsafeUnpin,

§

impl<T> UnwindSafe for Scheduling<T>
where T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.