pub struct NonZero<T>(pub T);Expand description
A non-zero value wrapper.
This wrapper validates that literal values are != 0 at parse time.
Tuple Fields§
§0: TImplementations§
Trait Implementations§
Source§impl<T: Ord> Ord for NonZero<T>
impl<T: Ord> Ord for NonZero<T>
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: PartialOrd> PartialOrd for NonZero<T>
impl<T: PartialOrd> PartialOrd for NonZero<T>
Source§impl<T: SemanticEq> SemanticEq for NonZero<T>
impl<T: SemanticEq> SemanticEq for NonZero<T>
Source§fn semantic_eq(&self, other: &Self) -> bool
fn semantic_eq(&self, other: &Self) -> bool
Returns
true if self and other are semantically equal.Source§impl<T> ToCursors for NonZero<T>where
T: ToCursors,
impl<T> ToCursors for NonZero<T>where
T: ToCursors,
fn to_cursors(&self, s: &mut impl CursorSink)
impl<T: Copy> Copy for NonZero<T>
impl<T: Eq> Eq for NonZero<T>
impl<T> StructuralPartialEq for NonZero<T>
Auto Trait Implementations§
impl<T> Freeze for NonZero<T>where
T: Freeze,
impl<T> RefUnwindSafe for NonZero<T>where
T: RefUnwindSafe,
impl<T> Send for NonZero<T>where
T: Send,
impl<T> Sync for NonZero<T>where
T: Sync,
impl<T> Unpin for NonZero<T>where
T: Unpin,
impl<T> UnsafeUnpin for NonZero<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for NonZero<T>where
T: UnwindSafe,
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