[][src]Struct scrummage::Priority

pub struct 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]

impl PartialEq<Priority> for Priority[src]

impl PartialOrd<Priority> for Priority[src]

impl StructuralEq for Priority[src]

impl StructuralPartialEq for Priority[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.