pub struct ArchivedOptionNonZeroU128 { /* private fields */ }
Expand description

A niched archived Option<NonZeroU128>

Implementations§

source§

impl ArchivedOptionNonZeroU128

source

pub fn is_none(&self) -> bool

Returns true if the option is a None value.

source

pub fn is_some(&self) -> bool

Returns true if the option is a Some value.

source

pub fn as_ref(&self) -> Option<&Archived<NonZeroU128>>

Converts to an Option<&Archived<NonZeroU128>>

source

pub fn as_mut(&mut self) -> Option<&mut Archived<NonZeroU128>>

Converts to an Option<&mut Archived<NonZeroU128>>

source

pub fn as_pin_ref(self: Pin<&Self>) -> Option<Pin<&Archived<NonZeroU128>>>

Converts from Pin<&ArchivedOptionNonZeroU128> to Option<Pin<&Archived<NonZeroU128>>>.

source

pub fn as_pin_mut( self: Pin<&mut Self> ) -> Option<Pin<&mut Archived<NonZeroU128>>>

Converts from Pin<&mut ArchivedOptionNonZeroU128> to Option<Pin<&mut Archived<NonZeroU128>>>.

source

pub fn iter(&self) -> Iter<'_, Archived<NonZeroU128>>

Returns an iterator over the possibly contained value.

source

pub fn iter_mut(&mut self) -> IterMut<'_, Archived<NonZeroU128>>

Returns a mutable iterator over the possibly contained value.

source

pub fn get_or_insert(&mut self, v: NonZeroU128) -> &mut Archived<NonZeroU128>

Inserts v into the option if it is None, then returns a mutable reference to the contained value.

source

pub fn get_or_insert_with<F: FnOnce() -> NonZeroU128>( &mut self, f: F ) -> &mut Archived<NonZeroU128>

Inserts a value computed from f into the option if it is None, then returns a mutable reference to the contained value.

source

pub unsafe fn resolve_from_option(field: Option<NonZeroU128>, out: *mut Self)

Resolves an ArchivedOptionNonZero from an Option<NonZero>.

§Safety
  • pos must be the position of out within the archive

Trait Implementations§

source§

impl Debug for ArchivedOptionNonZeroU128

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<D: Fallible + ?Sized> DeserializeWith<ArchivedOptionNonZeroU128, Option<NonZero<u128>>, D> for Niche

source§

fn deserialize_with( field: &ArchivedOptionNonZeroU128, _: &mut D ) -> Result<Option<NonZeroU128>, D::Error>

Deserializes the field type F using the given deserializer.
source§

impl Hash for ArchivedOptionNonZeroU128

source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Ord for ArchivedOptionNonZeroU128

source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for ArchivedOptionNonZeroU128

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for ArchivedOptionNonZeroU128

source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Eq for ArchivedOptionNonZeroU128

Auto Trait Implementations§

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> ArchivePointee for T

§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
source§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
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
§

impl<T> CallHasher for T
where T: Hash + ?Sized,

§

default fn get_hash<H, B>(value: &H, build_hasher: &B) -> u64
where H: Hash + ?Sized, B: BuildHasher,

source§

impl<F, W, T, D> Deserialize<With<T, W>, D> for F
where W: DeserializeWith<F, T, D>, D: Fallible + ?Sized, F: ?Sized,

source§

fn deserialize( &self, deserializer: &mut D ) -> Result<With<T, W>, <D as Fallible>::Error>

Deserializes using the given deserializer
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> LayoutRaw for T

source§

fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>

Gets the layout of the type.
source§

impl<T> Pointee for T

§

type Metadata = ()

The type for metadata in pointers and references to Self.
source§

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

§

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>,

§

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.