pub struct Priority(_);
Expand description
Issue with closures and static tasks
Every closure has its own anonymous type. A closure can only be stored in a generic struct. The task object stored in the task “list” (array) must all have the same size -> not generic. Thus, the closure can only be referenced as trait object. But need to force the closure to be static, so our reference can be as well. A static closure is not possible, as every static needs a specified type. To overcome the issue of storing a closure into a static task we need to copy it into a static stack. Access to the closure is provided via a closure trait object, which now references a static object which cannot go out of scope. Task priority.
0 is the highest priority.
Implementations
Trait Implementations
sourceimpl PartialOrd<Priority> for Priority
impl PartialOrd<Priority> for Priority
sourcefn partial_cmp(&self, other: &Priority) -> Option<Ordering>
fn partial_cmp(&self, other: &Priority) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl Copy for Priority
impl StructuralPartialEq for Priority
Auto Trait Implementations
impl RefUnwindSafe for Priority
impl Send for Priority
impl Sync for Priority
impl Unpin for Priority
impl UnwindSafe for Priority
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more