[−][src]Struct scrummage::Priority
A prioritisation level
The priority of a Process
controls how much CPU time it gets
compared to other processes. Most programs don't need to be handled
especially, and should be given a normal priority
to allow the OS to handle scheduling
Implementations
impl Priority
[src]
pub fn normal() -> Self
[src]
The priority level given to normal processes; The default priority level.
assert_eq!(Process::current().priority().unwrap(), Priority::normal(), "I'm normal! Normal I tell you!");
pub fn higher(&self) -> impl Iterator<Item = Self>
[src]
Raise the priority level.
Be particularly careful with giving processes higher priority levels:
Any process with a lower level will be halted until it pauses.
Therefore, make sure any work it does is breif, and it uses OS APIs for
delays (std::thread::sleep
instead of loop {}
)
pub fn lower(&self) -> impl Iterator<Item = Self>
[src]
Lower the priority level.
Processes with lower priority levels will pause if other processes need to do work. They can be used for screen-savers e.t.c.
Trait Implementations
impl Debug for Priority
[src]
impl Eq for Priority
[src]
impl Ord for Priority
[src]
fn cmp(&self, other: &Priority) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<Priority> for Priority
[src]
impl PartialOrd<Priority> for Priority
[src]
fn partial_cmp(&self, other: &Priority) -> Option<Ordering>
[src]
fn lt(&self, other: &Priority) -> bool
[src]
fn le(&self, other: &Priority) -> bool
[src]
fn gt(&self, other: &Priority) -> bool
[src]
fn ge(&self, other: &Priority) -> bool
[src]
impl StructuralEq for Priority
[src]
impl StructuralPartialEq for Priority
[src]
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
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,