[−][src]Struct r3::hunk::Hunk
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]
pub fn clone(&self) -> Self
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[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]
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
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,