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

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

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

impl<System: Kernel, T: ?Sized> Hunk<System, T>[src]

pub const fn build() -> CfgHunkBuilder<System, T, DefaultInitTag>[src]

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

impl<System, T: ?Sized> Hunk<System, T>[src]

pub const unsafe fn transmute<U>(self) -> Hunk<System, U>[src]

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.

impl<System: Kernel, T: ?Sized> Hunk<System, T>[src]

pub fn untyped_hunk(this: Self) -> Hunk<System>[src]

Get the untyped hunk.

pub fn as_ptr(this: Self) -> *const T[src]

Get a raw pointer to the hunk's contents.

pub fn as_bytes_ptr(this: Self) -> *const [u8][src]

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

pub unsafe fn as_bytes(this: Self) -> &'static [u8][src]

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

impl<System: Kernel, T: ?Sized> AsRef<T> for Hunk<System, T>[src]

impl<System, T: ?Sized> Clone for Hunk<System, T>[src]

impl<System, T: ?Sized> Copy for Hunk<System, T>[src]

impl<System: Kernel, T: Debug + ?Sized> Debug for Hunk<System, T>[src]

impl<System: Kernel, T: ?Sized> Deref for Hunk<System, T>[src]

type Target = T

The resulting type after dereferencing.

impl<System, T> Init for Hunk<System, [T]>[src]

impl<System, T: ?Sized + Send> Send for Hunk<System, T>[src]

impl<System, T: ?Sized + Sync> Sync for Hunk<System, T>[src]

Auto Trait Implementations

impl<System, T: ?Sized> Unpin for Hunk<System, T> where
    System: Unpin
[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.