Struct r3_core::hunk::HunkDefiner

source ·
pub struct HunkDefiner<System, T: ?Sized, InitTag> { /* private fields */ }
Expand description

The definer (static builder) for Hunk.

InitTag is either DefaultInitTag or ZeroInitTag.

Implementations§

source§

impl<System: KernelBase + KernelStatic, T: ?Sized, InitTag> HunkDefiner<System, T, InitTag>

source

pub const fn len(self, len: usize) -> Self

Specify the element count. Defaults to 1. Must be 1 for a non-array hunk.

source

pub const fn align(self, align: usize) -> Self

Specify the minimum alignment. Defaults to 1.

source

pub const fn zeroed(self) -> HunkDefiner<System, T, ZeroInitTag>where T: Zeroable,

Zero-initialize the hunk.

source

pub const unsafe fn zeroed_unchecked( self ) -> HunkDefiner<System, T, ZeroInitTag>

Zero-initialize the hunk even if it might be unsafe.

Safety

If zero initialization is not a valid bit pattern for T, accessing the hunk’s contents may result in an undefined behavior.

source§

impl<System: KernelBase + KernelStatic, T, InitTag: HunkIniter<T>> HunkDefiner<System, T, InitTag>

source

pub const fn finish<C: CfgBase<System = System>>( self, cfg: &mut Cfg<'_, C> ) -> Hunk<System, T>

Complete the definition of a hunk, returning a reference to the hunk.

source§

impl<System: KernelBase + KernelStatic, T, InitTag: HunkIniter<T>> HunkDefiner<System, [T], InitTag>

source

pub const fn finish<C: CfgBase<System = System>>( self, cfg: &mut Cfg<'_, C> ) -> Hunk<System, [T]>

Complete the definition of a hunk, returning a reference to the hunk.

Auto Trait Implementations§

§

impl<System, T: ?Sized, InitTag> RefUnwindSafe for HunkDefiner<System, T, InitTag>where InitTag: RefUnwindSafe, System: RefUnwindSafe, T: RefUnwindSafe,

§

impl<System, T: ?Sized, InitTag> Send for HunkDefiner<System, T, InitTag>where InitTag: Send, System: Send, T: Send,

§

impl<System, T: ?Sized, InitTag> Sync for HunkDefiner<System, T, InitTag>where InitTag: Sync, System: Sync, T: Sync,

§

impl<System, T: ?Sized, InitTag> Unpin for HunkDefiner<System, T, InitTag>where InitTag: Unpin, System: Unpin, T: Unpin,

§

impl<System, T: ?Sized, InitTag> UnwindSafe for HunkDefiner<System, T, InitTag>where InitTag: UnwindSafe, System: UnwindSafe, T: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.