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