Macro kernel::impl_has_work

source ·
macro_rules! impl_has_work {
    ($(impl$(<$($implarg:ident),*>)?
       HasWork<$work_type:ty $(, $id:tt)?>
       for $self:ident $(<$($selfarg:ident),*>)?
       { self.$field:ident }
    )*) => { ... };
}
Expand description

Used to safely implement the HasWork<T, ID> trait.

Examples

use kernel::impl_has_work;
use kernel::sync::Arc;
use kernel::workqueue::{self, Work};

struct MyStruct {
    work_field: Work<MyStruct, 17>,
}

impl_has_work! {
    impl HasWork<MyStruct, 17> for MyStruct { self.work_field }
}
This documentation is an old archive. Please see https://rust.docs.kernel.org instead.