Trait Work
pub trait Work: Sized {
// Required method
fn label(&self) -> &'static str;
// Provided method
fn is_pending(&self) -> bool { ... }
}Expand description
Work whose completion rules are defined by its type.
Implement this beside the work type. Its constructors, execution and Extend
implementations must preserve unfinished work. These implementations need
review: the wrapper cannot verify them. Keep the obligation private in the
type that controls its execution. Do not implement Work for arbitrary futures
or callbacks.
Required Methods§
Provided Methods§
fn is_pending(&self) -> bool
fn is_pending(&self) -> bool
Whether the work needs to run. Batch types can return false when empty.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.