Struct r3::hunk::Hunk[][src]

pub struct Hunk<System, T: ?Sized> { /* fields omitted */ }
Expand description

Represents a single typed 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 type is implemented on top of r3::kernel::Hunk, the untyped hunk type.

Implementations

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

Reinterpret the hunk as another type.

Safety
  • Similarly to core::mem::transmute, this is incredibly unsafe.
  • The byte offset must be valid for the destination type.

Get the untyped hunk.

Get a raw pointer to the hunk’s contents.

Get a raw pointer to the raw bytes of the hunk.

Get a reference to the raw bytes of the hunk.

Safety

The result might include uninitialized bytes and/or interior mutability, so it might be unsafe to access.

Trait Implementations

Performs the conversion.

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 resulting type after dereferencing.

Dereferences the value.

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

Performs the conversion.

Performs the conversion.

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.