pub struct NonZeroI128(/* private fields */);Implementations§
Source§impl NonZeroI128
impl NonZeroI128
Sourcepub const fn new(value: i128) -> Option<Self>
pub const fn new(value: i128) -> Option<Self>
Creates a non-zero if the given value is not zero.
Sourcepub const unsafe fn new_unchecked(value: i128) -> Self
pub const unsafe fn new_unchecked(value: i128) -> 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) -> i128
pub const fn into_std(self) -> NonZeroI128
pub const fn from_std(value: NonZeroI128) -> Self
Trait Implementations§
Source§impl Clone for NonZeroI128
impl Clone for NonZeroI128
Source§fn clone(&self) -> NonZeroI128
fn clone(&self) -> NonZeroI128
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 NonZeroI128
impl Debug for NonZeroI128
Source§impl Display for NonZeroI128
impl Display for NonZeroI128
Source§impl Hash for NonZeroI128
impl Hash for NonZeroI128
Source§impl Ord for NonZeroI128
impl Ord for NonZeroI128
Source§fn cmp(&self, other: &NonZeroI128) -> Ordering
fn cmp(&self, other: &NonZeroI128) -> 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 NonZeroI128
impl PartialEq for NonZeroI128
Source§impl PartialOrd for NonZeroI128
impl PartialOrd for NonZeroI128
impl ConstParamTy_ for NonZeroI128
impl Copy for NonZeroI128
impl Eq for NonZeroI128
impl StructuralPartialEq for NonZeroI128
Auto Trait Implementations§
impl Freeze for NonZeroI128
impl RefUnwindSafe for NonZeroI128
impl Send for NonZeroI128
impl Sync for NonZeroI128
impl Unpin for NonZeroI128
impl UnwindSafe for NonZeroI128
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