Skip to main content

VarRefField

Enum VarRefField 

Source
pub enum VarRefField<'a, T, S, const VAR_IDX: usize, const IDX: usize> {
    Ref(RefField<'a, T, S, IDX>),
    Header(RefField<'a, T, S, IDX>),
    Empty(Empty<T, S, VAR_IDX, IDX>),
}

Variants§

§

Ref(RefField<'a, T, S, IDX>)

§

Header(RefField<'a, T, S, IDX>)

§

Empty(Empty<T, S, VAR_IDX, IDX>)

Implementations§

Source§

impl<'a, S, const VAR_IDX: usize, const IDX: usize> VarRefField<'a, VariantHeader, S, VAR_IDX, IDX>

Source

pub fn header(header: &'a VariantHeader) -> Self

Source§

impl<'a, T, S, const VAR_IDX: usize, const IDX: usize> VarRefField<'a, T, S, VAR_IDX, IDX>

Source

pub fn new(t: &'a T) -> Self

Source

pub fn empty() -> Self

Source

pub fn has_value(&self) -> bool

Trait Implementations§

Source§

impl<'a, T, S, const VAR_IDX: usize, const IDX: usize> Access for VarRefField<'a, T, S, VAR_IDX, IDX>

Source§

type Out = &'a T

Source§

fn access(self) -> Self::Out

Source§

impl<'a, T, S, const VAR_IDX: usize, const IDX: usize> Clone for VarRefField<'a, T, S, VAR_IDX, IDX>
where RefField<'a, T, S, IDX>: Clone,

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T, S: FieldsMeta, const VAR_IDX: usize, const IDX: usize> Field for VarRefField<'_, T, S, VAR_IDX, IDX>

Source§

const IDX: usize = IDX

Source§

type Source = S

Source§

type Content = T

Source§

type Referenced<'a> = VarRefField<'a, <VarRefField<'_, T, S, VAR_IDX, IDX> as Field>::Content, S, VAR_IDX, IDX> where Self::Content: 'a

Source§

type MutablyReferenced<'a> = VarMutField<'a, <VarRefField<'_, T, S, VAR_IDX, IDX> as Field>::Content, S, VAR_IDX, IDX> where Self::Content: 'a

Source§

type Owned = VarOwnedField<T, S, VAR_IDX, IDX>

Source§

impl<T, S, const VAR_IDX: usize, const IDX: usize> Phantom for VarRefField<'_, T, S, VAR_IDX, IDX>

Source§

fn phantom() -> Self

Source§

fn copy(&self) -> Self

Source§

impl<'a, T, S, const VAR_IDX: usize, const IDX: usize> TryAccess for VarRefField<'a, T, S, VAR_IDX, IDX>

Source§

type Err = RefEnumAccessError<'a, T, S, VAR_IDX, IDX>

Source§

type Out = &'a T

Source§

fn try_access(self) -> Result<Self::Out, Self::Err>

Source§

impl<'a, T, S, const VAR_IDX: usize, const IDX: usize> VarField for VarRefField<'a, T, S, VAR_IDX, IDX>
where S: VariantOffset<VAR_IDX> + FieldsMeta,

Source§

const VAR_IDX: usize = VAR_IDX

Source§

const FIELD_IDX: usize = <Self as Field>::IDX

Auto Trait Implementations§

§

impl<'a, T, S, const VAR_IDX: usize, const IDX: usize> Freeze for VarRefField<'a, T, S, VAR_IDX, IDX>

§

impl<'a, T, S, const VAR_IDX: usize, const IDX: usize> RefUnwindSafe for VarRefField<'a, T, S, VAR_IDX, IDX>

§

impl<'a, T, S, const VAR_IDX: usize, const IDX: usize> Send for VarRefField<'a, T, S, VAR_IDX, IDX>
where S: Send, T: Send + Sync,

§

impl<'a, T, S, const VAR_IDX: usize, const IDX: usize> Sync for VarRefField<'a, T, S, VAR_IDX, IDX>
where S: Sync, T: Sync,

§

impl<'a, T, S, const VAR_IDX: usize, const IDX: usize> Unpin for VarRefField<'a, T, S, VAR_IDX, IDX>
where S: Unpin, T: Unpin,

§

impl<'a, T, S, const VAR_IDX: usize, const IDX: usize> UnsafeUnpin for VarRefField<'a, T, S, VAR_IDX, IDX>

§

impl<'a, T, S, const VAR_IDX: usize, const IDX: usize> UnwindSafe for VarRefField<'a, T, S, VAR_IDX, IDX>

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> Mask<List<()>> for T

Source§

type Out = T

Source§

fn mask(self, _mask: List<()>) -> <T as Mask<List<()>>>::Out

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.