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