pub unsafe trait WorkItemPointer<const ID: u64>: RawWorkItem<ID> {
// Required method
unsafe extern "C" fn run(ptr: *mut work_struct);
}Expand description
Defines the method that should be called directly when a work item is executed.
This trait is implemented by Pin<KBox<T>> and Arc<T>, and is mainly intended to be
implemented for smart pointer types. For your own structs, you would implement WorkItem
instead. The run method on this trait will usually just perform the appropriate
container_of translation and then call into the run method from the
WorkItem trait.
This trait is used when the work_struct field is defined using the Work helper.
§Safety
Implementers must ensure that __enqueue uses a work_struct initialized with the run
method of this trait as the function pointer.
Required Methods§
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.