pub struct NonZeroU128(/* private fields */);Implementations§
Source§impl NonZeroU128
impl NonZeroU128
Sourcepub const fn new(value: u128) -> Option<Self>
pub const fn new(value: u128) -> Option<Self>
Creates a non-zero if the given value is not zero.
Sourcepub const unsafe fn new_unchecked(value: u128) -> Self
pub const unsafe fn new_unchecked(value: u128) -> Self
Creates a non-zero without checking whether the value is non-zero. This results in undefined behaviour if the value is zero.
§Safety
The value must not be zero.
pub const fn get(self) -> u128
pub const fn into_std(self) -> NonZeroU128
pub const fn from_std(value: NonZeroU128) -> Self
Trait Implementations§
Source§impl Clone for NonZeroU128
impl Clone for NonZeroU128
Source§fn clone(&self) -> NonZeroU128
fn clone(&self) -> NonZeroU128
Returns a duplicate 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 Debug for NonZeroU128
impl Debug for NonZeroU128
Source§impl Display for NonZeroU128
impl Display for NonZeroU128
Source§impl Hash for NonZeroU128
impl Hash for NonZeroU128
Source§impl Ord for NonZeroU128
impl Ord for NonZeroU128
Source§fn cmp(&self, other: &NonZeroU128) -> Ordering
fn cmp(&self, other: &NonZeroU128) -> 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 PartialEq for NonZeroU128
impl PartialEq for NonZeroU128
Source§impl PartialOrd for NonZeroU128
impl PartialOrd for NonZeroU128
impl ConstParamTy_ for NonZeroU128
impl Copy for NonZeroU128
impl Eq for NonZeroU128
impl StructuralPartialEq for NonZeroU128
Auto Trait Implementations§
impl Freeze for NonZeroU128
impl RefUnwindSafe for NonZeroU128
impl Send for NonZeroU128
impl Sync for NonZeroU128
impl Unpin for NonZeroU128
impl UnwindSafe for NonZeroU128
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