pub struct Multiplicity(/* private fields */);
Expand description
A scalar type common for node capacity, harc weight and state.
Valid multiplicities are nonnegative integers or ω.
Implementations§
Source§impl Multiplicity
impl Multiplicity
pub const fn omega() -> Self
pub fn finite(value: u64) -> Option<Self>
pub const fn zero() -> Self
pub const fn one() -> Self
pub fn is_omega(self) -> bool
pub fn is_zero(self) -> bool
pub fn is_finite(self) -> bool
pub fn is_positive(self) -> bool
pub fn checked_add(self, other: Self) -> Option<Self>
pub fn checked_sub(self, other: Self) -> Option<Self>
Sourcepub fn saturating_add(self, other: Self) -> Self
pub fn saturating_add(self, other: Self) -> Self
Note: don’t use this for evaluation of state transition; call
checked_add()
instead.
Sourcepub fn saturating_sub(self, other: Self) -> Self
pub fn saturating_sub(self, other: Self) -> Self
Note: don’t use this for evaluation of state transition; call
checked_sub()
instead.
Trait Implementations§
Source§impl Clone for Multiplicity
impl Clone for Multiplicity
Source§fn clone(&self) -> Multiplicity
fn clone(&self) -> Multiplicity
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 Multiplicity
impl Debug for Multiplicity
Source§impl Display for Multiplicity
impl Display for Multiplicity
Source§impl FromStr for Multiplicity
impl FromStr for Multiplicity
Source§impl Hash for Multiplicity
impl Hash for Multiplicity
Source§impl Ord for Multiplicity
impl Ord for Multiplicity
Source§fn cmp(&self, other: &Multiplicity) -> Ordering
fn cmp(&self, other: &Multiplicity) -> 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 Multiplicity
impl PartialEq for Multiplicity
Source§impl PartialOrd for Multiplicity
impl PartialOrd for Multiplicity
impl Copy for Multiplicity
impl Eq for Multiplicity
impl StructuralPartialEq for Multiplicity
Auto Trait Implementations§
impl Freeze for Multiplicity
impl RefUnwindSafe for Multiplicity
impl Send for Multiplicity
impl Sync for Multiplicity
impl Unpin for Multiplicity
impl UnwindSafe for Multiplicity
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