logo
pub struct Hunk<System: KernelStatic> { /* private fields */ }
Expand description

Represents a single hunk in a system.

Hunks are nothing more than static variables defined in a kernel configuration. They come in handy when you are designing a component that can be instantiated by a kernel configuration and wanting each instance to have its own separate state data.

This Hunk is untyped and only contains a starting address. See r3::hunk::Hunk for a type-safe wrapper of Hunk.

Relation to Other Specifications: None. The need for programmatically defining static regions has been traditionally fulfilled by code generation and preprocessor-based composition. The closest thing might be cell internal variables in the component system that comes with the TOPPERS kernels.

Implementations

Construct a HunkDefiner to define a hunk in a configuration function.

Get the offset of the hunk.

Get a raw pointer to the hunk’s contents.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

The default value.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.