1.28.0[−][src]Struct core::num::NonZeroU64
An integer that is known not to equal zero.
This enables some memory layout optimization.
For example, Option<NonZeroU64> is the same size as u64:
use std::mem::size_of; assert_eq!(size_of::<Option<std::num::NonZeroU64>>(), size_of::<u64>());Run
Methods
impl NonZeroU64[src]
impl NonZeroU64pub const unsafe fn new_unchecked(n: u64) -> Self[src]
pub const unsafe fn new_unchecked(n: u64) -> Selfpub fn new(n: u64) -> Option<Self>[src]
pub fn new(n: u64) -> Option<Self>Create a non-zero if the given value is not zero.
pub fn get(self) -> u64[src]
pub fn get(self) -> u64Returns the value as a primitive type.
Trait Implementations
impl Copy for NonZeroU64[src]
impl Copy for NonZeroU64impl PartialEq<NonZeroU64> for NonZeroU64[src]
impl PartialEq<NonZeroU64> for NonZeroU64fn eq(&self, other: &NonZeroU64) -> bool[src]
fn eq(&self, other: &NonZeroU64) -> boolfn ne(&self, other: &NonZeroU64) -> bool[src]
fn ne(&self, other: &NonZeroU64) -> boolimpl Eq for NonZeroU64[src]
impl Eq for NonZeroU64impl Ord for NonZeroU64[src]
impl Ord for NonZeroU64fn cmp(&self, other: &NonZeroU64) -> Ordering[src]
fn cmp(&self, other: &NonZeroU64) -> Orderingfn max(self, other: Self) -> Self where
Self: Sized, 1.21.0[src]
fn max(self, other: Self) -> Self where
Self: Sized, 1.21.0
[src]Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self where
Self: Sized, 1.21.0[src]
fn min(self, other: Self) -> Self where
Self: Sized, 1.21.0
[src]Compares and returns the minimum of two values. Read more
impl PartialOrd<NonZeroU64> for NonZeroU64[src]
impl PartialOrd<NonZeroU64> for NonZeroU64fn partial_cmp(&self, other: &NonZeroU64) -> Option<Ordering>[src]
fn partial_cmp(&self, other: &NonZeroU64) -> Option<Ordering>fn lt(&self, other: &NonZeroU64) -> bool[src]
fn lt(&self, other: &NonZeroU64) -> boolfn le(&self, other: &NonZeroU64) -> bool[src]
fn le(&self, other: &NonZeroU64) -> boolfn gt(&self, other: &NonZeroU64) -> bool[src]
fn gt(&self, other: &NonZeroU64) -> boolfn ge(&self, other: &NonZeroU64) -> bool[src]
fn ge(&self, other: &NonZeroU64) -> boolimpl Clone for NonZeroU64[src]
impl Clone for NonZeroU64fn clone(&self) -> NonZeroU64[src]
fn clone(&self) -> NonZeroU64fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)1.0.0
[src]Performs copy-assignment from source. Read more
impl From<NonZeroU64> for u641.31.0[src]
impl From<NonZeroU64> for u641.31.0
[src]fn from(nonzero: NonZeroU64) -> Self[src]
fn from(nonzero: NonZeroU64) -> Selfimpl Hash for NonZeroU64[src]
impl Hash for NonZeroU64fn hash<__H: Hasher>(&self, state: &mut __H)[src]
fn hash<__H: Hasher>(&self, state: &mut __H)fn hash_slice<H: Hasher>(data: &[Self], state: &mut H) where
Self: Sized, 1.3.0[src]
fn hash_slice<H: Hasher>(data: &[Self], state: &mut H) where
Self: Sized, 1.3.0
[src]Feeds a slice of this type into the given [Hasher]. Read more
impl Debug for NonZeroU64[src]
impl Debug for NonZeroU64impl Display for NonZeroU64[src]
impl Display for NonZeroU64impl Octal for NonZeroU64[src]
impl Octal for NonZeroU64impl Binary for NonZeroU64[src]
impl Binary for NonZeroU64impl LowerHex for NonZeroU64[src]
impl LowerHex for NonZeroU64impl UpperHex for NonZeroU64[src]
impl UpperHex for NonZeroU64Auto Trait Implementations
impl Send for NonZeroU64
impl Send for NonZeroU64impl Sync for NonZeroU64
impl Sync for NonZeroU64Blanket Implementations
impl<T, U> Into for T where
U: From<T>, [src]
impl<T, U> Into for T where
U: From<T>, impl<T> From for T[src]
impl<T> From for Timpl<T, U> TryInto for T where
U: TryFrom<T>, [src]
impl<T, U> TryInto for T where
U: TryFrom<T>, type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(Self) -> Result<U, <U as TryFrom<T>>::Error>[src]
fn try_into(Self) -> Result<U, <U as TryFrom<T>>::Error>impl<T, U> TryFrom for T where
T: From<U>, [src]
impl<T, U> TryFrom for T where
T: From<U>, type Error = !
The type returned in the event of a conversion error.
fn try_from(U) -> Result<T, <T as TryFrom<U>>::Error>[src]
fn try_from(U) -> Result<T, <T as TryFrom<U>>::Error>impl<T> Borrow for T where
T: ?Sized, [src]
impl<T> Borrow for T where
T: ?Sized, impl<T> BorrowMut for T where
T: ?Sized, [src]
impl<T> BorrowMut for T where
T: ?Sized, fn borrow_mut(&mut Self) -> &mut T[src]
fn borrow_mut(&mut Self) -> &mut Timpl<T> Any for T where
T: 'static + ?Sized, [src]
impl<T> Any for T where
T: 'static + ?Sized, fn get_type_id(&Self) -> TypeId[src]
fn get_type_id(&Self) -> TypeId