#[repr(u8)]pub enum Priority {
RealtimeAudio = 0,
High = 1,
Medium = 2,
Low = 3,
}Expand description
Task priority for background tasks.
Higher priority tasks are more likely to be scheduled before lower priority tasks, but this is not a strict guarantee - the scheduler may interleave tasks of different priorities to prevent starvation.
Variants§
RealtimeAudio = 0
Realtime priority
Spawning a task with this priority will spin it off on a separate thread dedicated just to that task. Only use for audio.
High = 1
High priority - use for tasks critical to user experience/responsiveness.
Medium = 2
Medium priority - suitable for most use cases.
Low = 3
Low priority - use for background work that can be deprioritized.
Implementations§
Trait Implementations§
impl Copy for Priority
impl Eq for Priority
impl StructuralPartialEq for Priority
Auto Trait Implementations§
impl Freeze for Priority
impl RefUnwindSafe for Priority
impl Send for Priority
impl Sync for Priority
impl Unpin for Priority
impl UnsafeUnpin for Priority
impl UnwindSafe for Priority
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