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§
Provided Methods§
Sourcefn priority(&self) -> TaskPriority
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".