Struct necsim_core_bond::OffByOneU32
source · pub struct OffByOneU32(/* private fields */);
Implementations§
source§impl OffByOneU32
impl OffByOneU32
sourcepub const fn new(value: u64) -> Result<Self, OffByOneU32Error>
pub const fn new(value: u64) -> Result<Self, OffByOneU32Error>
§Errors
Returns OffByOneU32Error
if not 1 <= value <= 2^32
sourcepub const unsafe fn new_unchecked(value: u64) -> Self
pub const unsafe fn new_unchecked(value: u64) -> Self
pub const fn get(self) -> u64
pub const fn add_incl(self, other: u32) -> u32
pub const fn add_excl(self, other: u32) -> u32
pub const fn one() -> Self
pub const fn max() -> Self
pub const fn inv(self) -> u32
Trait Implementations§
source§impl Clone for OffByOneU32
impl Clone for OffByOneU32
source§fn clone(&self) -> OffByOneU32
fn clone(&self) -> OffByOneU32
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 OffByOneU32
impl ComputeTypeSet for OffByOneU32
source§impl Debug for OffByOneU32
impl Debug for OffByOneU32
source§impl<'de> Deserialize<'de> for OffByOneU32
impl<'de> Deserialize<'de> for OffByOneU32
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 OffByOneU32
impl Display for OffByOneU32
source§impl From<OffByOneU32> for NonZeroU64
impl From<OffByOneU32> for NonZeroU64
source§fn from(val: OffByOneU32) -> Self
fn from(val: OffByOneU32) -> 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<OffByOneU32> for f64
impl From<OffByOneU32> for f64
source§fn from(val: OffByOneU32) -> Self
fn from(val: OffByOneU32) -> Self
Converts to this type from the input type.
source§impl From<OffByOneU32> for i64
impl From<OffByOneU32> for i64
source§fn from(val: OffByOneU32) -> Self
fn from(val: OffByOneU32) -> Self
Converts to this type from the input type.
source§impl From<OffByOneU32> for u64
impl From<OffByOneU32> for u64
source§fn from(val: OffByOneU32) -> Self
fn from(val: OffByOneU32) -> Self
Converts to this type from the input type.
source§impl From<OffByOneU32> for usize
impl From<OffByOneU32> for usize
source§fn from(val: OffByOneU32) -> Self
fn from(val: OffByOneU32) -> Self
Converts to this type from the input type.
source§impl Hash for OffByOneU32
impl Hash for OffByOneU32
source§impl Ord for OffByOneU32
impl Ord for OffByOneU32
source§fn cmp(&self, other: &OffByOneU32) -> Ordering
fn cmp(&self, other: &OffByOneU32) -> 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 OffByOneU32
impl PartialEq for OffByOneU32
source§fn eq(&self, other: &OffByOneU32) -> bool
fn eq(&self, other: &OffByOneU32) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for OffByOneU32
impl PartialOrd for OffByOneU32
source§fn partial_cmp(&self, other: &OffByOneU32) -> Option<Ordering>
fn partial_cmp(&self, other: &OffByOneU32) -> 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 OffByOneU32
impl Serialize for OffByOneU32
source§impl TryFrom<u64> for OffByOneU32
impl TryFrom<u64> for OffByOneU32
source§impl TypeLayout for OffByOneU32
impl TypeLayout for OffByOneU32
§type Inhabited = <And<<u32 as TypeLayout>::Inhabited, Inhabited> as ComputeInhabited>::Output
type Inhabited = <And<<u32 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 OffByOneU32
impl Eq for OffByOneU32
impl StructuralPartialEq for OffByOneU32
Auto Trait Implementations§
impl Freeze for OffByOneU32
impl RefUnwindSafe for OffByOneU32
impl Send for OffByOneU32
impl Sync for OffByOneU32
impl Unpin for OffByOneU32
impl UnwindSafe for OffByOneU32
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.