pub trait Wrapped {
type T;
type I;
// Required method
fn get_wrapped(&self, args: Self::I) -> Self::T;
}
Expand description
Define the Wrapping of a kernel object.
This trait defines the association between a static kernel object and the two associated Rust
types: StaticThing
and Thing
. In the general case: there should be:
impl Wrapped for StaticKernelObject<kobj> {
type T = Thing,
type I = (),
fn get_wrapped(&self, args: Self::I) -> Self::T {
let ptr = self.value.get();
// Initizlie the kobj using ptr and possible the args.
Thing { ptr }
}
}
Required Associated Types§
Required Methods§
sourcefn get_wrapped(&self, args: Self::I) -> Self::T
fn get_wrapped(&self, args: Self::I) -> Self::T
Initialize this kernel object, and return the wrapped pointer.