Struct necsim_core_bond::OffByOneU64
source · pub struct OffByOneU64(/* private fields */);
Implementations§
source§impl OffByOneU64
impl OffByOneU64
sourcepub const fn new(value: u128) -> Result<Self, OffByOneU64Error>
pub const fn new(value: u128) -> Result<Self, OffByOneU64Error>
§Errors
Returns OffByOneU64Error
if not 1 <= value <= 2^64
sourcepub const unsafe fn new_unchecked(value: u128) -> Self
pub const unsafe fn new_unchecked(value: u128) -> Self
pub const fn get(self) -> u128
pub const fn add_incl(self, other: u64) -> u64
pub const fn add_excl(self, other: u64) -> u64
pub const fn one() -> Self
pub const fn max() -> Self
pub const fn inv(self) -> u64
Trait Implementations§
source§impl Add for OffByOneU64
impl Add for OffByOneU64
source§impl Clone for OffByOneU64
impl Clone for OffByOneU64
source§fn clone(&self) -> OffByOneU64
fn clone(&self) -> OffByOneU64
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 ComputeTypeSet for OffByOneU64
impl ComputeTypeSet for OffByOneU64
source§impl Debug for OffByOneU64
impl Debug for OffByOneU64
source§impl<'de> Deserialize<'de> for OffByOneU64
impl<'de> Deserialize<'de> for OffByOneU64
source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
source§impl Display for OffByOneU64
impl Display for OffByOneU64
source§impl From<NonZero<u32>> for OffByOneU64
impl From<NonZero<u32>> for OffByOneU64
source§fn from(val: NonZeroU32) -> Self
fn from(val: NonZeroU32) -> Self
Converts to this type from the input type.
source§impl From<NonZero<u64>> for OffByOneU64
impl From<NonZero<u64>> for OffByOneU64
source§fn from(val: NonZeroU64) -> Self
fn from(val: NonZeroU64) -> Self
Converts to this type from the input type.
source§impl From<OffByOneU32> for OffByOneU64
impl From<OffByOneU32> for OffByOneU64
source§fn from(val: OffByOneU32) -> Self
fn from(val: OffByOneU32) -> Self
Converts to this type from the input type.
source§impl From<OffByOneU64> for NonZeroU64
impl From<OffByOneU64> for NonZeroU64
source§fn from(val: OffByOneU64) -> Self
fn from(val: OffByOneU64) -> Self
Converts to this type from the input type.
source§impl From<OffByOneU64> for f64
impl From<OffByOneU64> for f64
source§fn from(val: OffByOneU64) -> Self
fn from(val: OffByOneU64) -> Self
Converts to this type from the input type.
source§impl From<OffByOneU64> for u128
impl From<OffByOneU64> for u128
source§fn from(val: OffByOneU64) -> Self
fn from(val: OffByOneU64) -> Self
Converts to this type from the input type.
source§impl Hash for OffByOneU64
impl Hash for OffByOneU64
source§impl Mul<ClosedUnitF64> for OffByOneU64
impl Mul<ClosedUnitF64> for OffByOneU64
§type Output = OffByOneU64
type Output = OffByOneU64
The resulting type after applying the
*
operator.source§impl Mul for OffByOneU64
impl Mul for OffByOneU64
source§impl Ord for OffByOneU64
impl Ord for OffByOneU64
source§fn cmp(&self, other: &OffByOneU64) -> Ordering
fn cmp(&self, other: &OffByOneU64) -> 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 OffByOneU64
impl PartialEq for OffByOneU64
source§fn eq(&self, other: &OffByOneU64) -> bool
fn eq(&self, other: &OffByOneU64) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for OffByOneU64
impl PartialOrd for OffByOneU64
source§fn partial_cmp(&self, other: &OffByOneU64) -> Option<Ordering>
fn partial_cmp(&self, other: &OffByOneU64) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl Serialize for OffByOneU64
impl Serialize for OffByOneU64
source§impl TryFrom<u128> for OffByOneU64
impl TryFrom<u128> for OffByOneU64
source§impl TypeLayout for OffByOneU64
impl TypeLayout for OffByOneU64
§type Inhabited = <And<<u64 as TypeLayout>::Inhabited, Inhabited> as ComputeInhabited>::Output
type Inhabited = <And<<u64 as TypeLayout>::Inhabited, Inhabited> as ComputeInhabited>::Output
Marker type for whether the type is
inhabited or
uninhabited.
The associated type must be either [
inhabited::Inhabited
]
or [inhabited::Uninhabited
].source§const TYPE_LAYOUT: TypeLayoutInfo<'static> = _
const TYPE_LAYOUT: TypeLayoutInfo<'static> = _
Shallow layout of the type.
impl Copy for OffByOneU64
impl Eq for OffByOneU64
impl StructuralPartialEq for OffByOneU64
Auto Trait Implementations§
impl Freeze for OffByOneU64
impl RefUnwindSafe for OffByOneU64
impl Send for OffByOneU64
impl Sync for OffByOneU64
impl Unpin for OffByOneU64
impl UnwindSafe for OffByOneU64
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
§impl<T> ExtractDiscriminant for T
impl<T> ExtractDiscriminant for T
§type Discriminant = <T as ExtractDiscriminantSpec<<T as DiscriminantKind>::Discriminant>>::Ty
type Discriminant = <T as ExtractDiscriminantSpec<<T as DiscriminantKind>::Discriminant>>::Ty
The type of the discriminant, which must satisfy the trait bounds
required by
core::mem::Discriminant
. Read more§impl<T> TypeGraphLayout for Twhere
T: TypeLayout + ComputeTypeSet,
impl<T> TypeGraphLayout for Twhere
T: TypeLayout + ComputeTypeSet,
§const TYPE_GRAPH: TypeLayoutGraph<'static> = _
const TYPE_GRAPH: TypeLayoutGraph<'static> = _
Shallow layout of the type.