Trait kernel::workqueue::WorkItemPointer
source · 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<Box<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.