pub struct NonzeroGeneration<T: NonZeroAble> { /* private fields */ }
Expand description
A generation counter which is always nonzero. Useful for size optimizations on Option
Trait Implementations§
Source§impl<T: Clone + NonZeroAble> Clone for NonzeroGeneration<T>
impl<T: Clone + NonZeroAble> Clone for NonzeroGeneration<T>
Source§fn clone(&self) -> NonzeroGeneration<T>
fn clone(&self) -> NonzeroGeneration<T>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<T: Debug + NonZeroAble> Debug for NonzeroGeneration<T>
impl<T: Debug + NonZeroAble> Debug for NonzeroGeneration<T>
Source§impl<T> FixedGenerationalIndex for NonzeroGeneration<T>where
T: NonZeroAble + One + Add<Output = T> + Copy + Eq + From<<<T as NonZeroAble>::NonZero as NonZero>::Primitive>,
T::NonZero: PartialOrd + Eq + Copy,
impl<T> FixedGenerationalIndex for NonzeroGeneration<T>where
T: NonZeroAble + One + Add<Output = T> + Copy + Eq + From<<<T as NonZeroAble>::NonZero as NonZero>::Primitive>,
T::NonZero: PartialOrd + Eq + Copy,
Source§fn first_generation() -> Self
fn first_generation() -> Self
Get an object representing the first possible generation
Source§fn generation_lt(&self, other: &Self) -> bool
fn generation_lt(&self, other: &Self) -> bool
Compare this generation with another.
Source§impl<T> GenerationalIndex for NonzeroGeneration<T>where
T: NonZeroAble + One + Add<Output = T> + Copy + Eq + From<<<T as NonZeroAble>::NonZero as NonZero>::Primitive>,
T::NonZero: PartialOrd + Eq + Copy,
impl<T> GenerationalIndex for NonzeroGeneration<T>where
T: NonZeroAble + One + Add<Output = T> + Copy + Eq + From<<<T as NonZeroAble>::NonZero as NonZero>::Primitive>,
T::NonZero: PartialOrd + Eq + Copy,
Source§fn increment_generation(&mut self)
fn increment_generation(&mut self)
Increment the generation of this object. May wrap or panic on overflow depending on type.
Source§impl<T: Ord + NonZeroAble> Ord for NonzeroGeneration<T>
impl<T: Ord + NonZeroAble> Ord for NonzeroGeneration<T>
Source§fn cmp(&self, other: &NonzeroGeneration<T>) -> Ordering
fn cmp(&self, other: &NonzeroGeneration<T>) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<T: PartialEq + NonZeroAble> PartialEq for NonzeroGeneration<T>
impl<T: PartialEq + NonZeroAble> PartialEq for NonzeroGeneration<T>
Source§impl<T: PartialOrd + NonZeroAble> PartialOrd for NonzeroGeneration<T>where
T::NonZero: PartialOrd,
impl<T: PartialOrd + NonZeroAble> PartialOrd for NonzeroGeneration<T>where
T::NonZero: PartialOrd,
impl<T: Copy + NonZeroAble> Copy for NonzeroGeneration<T>
impl<T: Eq + NonZeroAble> Eq for NonzeroGeneration<T>
impl<T: NonZeroAble> StructuralPartialEq for NonzeroGeneration<T>
Auto Trait Implementations§
impl<T> Freeze for NonzeroGeneration<T>
impl<T> RefUnwindSafe for NonzeroGeneration<T>
impl<T> Send for NonzeroGeneration<T>
impl<T> Sync for NonzeroGeneration<T>
impl<T> Unpin for NonzeroGeneration<T>
impl<T> UnwindSafe for NonzeroGeneration<T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more