Macro impl_has_delayed_work

Source
macro_rules! impl_has_delayed_work {
    ($(impl$({$($generics:tt)*})?
       HasDelayedWork<$work_type:ty $(, $id:tt)?>
       for $self:ty
       { self.$field:ident }
    )*) => { ... };
}
Expand description

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

This macro also implements the HasWork trait, so you do not need to use impl_has_work! when using this macro.

ยงExamples

use kernel::sync::Arc;
use kernel::workqueue::{self, impl_has_delayed_work, DelayedWork};

struct MyStruct<'a, T, const N: usize> {
    work_field: DelayedWork<MyStruct<'a, T, N>, 17>,
    f: fn(&'a [T; N]),
}

impl_has_delayed_work! {
    impl{'a, T, const N: usize} HasDelayedWork<MyStruct<'a, T, N>, 17>
    for MyStruct<'a, T, N> { self.work_field }
}