Skip to main content

Task

Trait Task 

Source
pub trait Task: Send + Sync {
    // Required methods
    fn id(&self) -> TaskId;
    fn name(&self) -> &str;

    // Provided method
    fn priority(&self) -> TaskPriority { ... }
}
Available on native and crate feature tasks only.
Expand description

Core trait that all tasks must implement, providing identity and metadata.

Required Methods§

Source

fn id(&self) -> TaskId

Returns the unique identifier for this task instance.

Source

fn name(&self) -> &str

Returns the name of this task type.

Provided Methods§

Source

fn priority(&self) -> TaskPriority

Returns the priority of this task. Defaults to medium priority (5).

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§