Enum InitMark

Source
pub enum InitMark<'s> {
    Struct {
        index: usize,
        set: &'s mut InitSet64,
    },
    Ignored,
}
Expand description

InitMark is used to track the initialization state of a single field within an InitSet64. It is part of a system used to progressively initialize structs, where each field’s initialization status is represented by a bit in a 64-bit set.

Variants§

§

Struct

Represents a field in a struct that needs to be tracked for initialization.

Fields

§index: usize

The index of the field in the struct (0-63).

§set: &'s mut InitSet64

A reference to the InitSet64 that tracks all fields’ initialization states.

§

Ignored

Represents a field or value that doesn’t need initialization tracking.

Implementations§

Source§

impl InitMark<'_>

Source

pub fn set(&mut self)

Marks the field as initialized by setting its corresponding bit in the InitSet64.

Source

pub fn unset(&mut self)

Marks the field as uninitialized by clearing its corresponding bit in the InitSet64.

Source

pub fn get(&self) -> bool

Checks if the field is marked as initialized.

Returns true if the field is initialized, false otherwise. Always returns true for Ignored fields.

Auto Trait Implementations§

§

impl<'s> Freeze for InitMark<'s>

§

impl<'s> RefUnwindSafe for InitMark<'s>

§

impl<'s> Send for InitMark<'s>

§

impl<'s> Sync for InitMark<'s>

§

impl<'s> Unpin for InitMark<'s>

§

impl<'s> !UnwindSafe for InitMark<'s>

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

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 T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.