pub struct NodeCount(pub usize);
Expand description
Node count. Right now it doubles as node weight in many places in the code, in the future we might need a new type for that.
Tuple Fields§
§0: usize
Implementations§
Source§impl NodeCount
impl NodeCount
pub fn into_range(self) -> Range<NodeIndex>
pub fn into_iterator(self) -> impl Iterator<Item = NodeIndex>
Sourcepub fn consensus_threshold(&self) -> NodeCount
pub fn consensus_threshold(&self) -> NodeCount
If this is the total node count, what number of nodes is required for secure consensus.
Trait Implementations§
Source§impl AddAssign for NodeCount
impl AddAssign for NodeCount
Source§fn add_assign(&mut self, rhs: NodeCount)
fn add_assign(&mut self, rhs: NodeCount)
Performs the
+=
operation. Read moreSource§impl Ord for NodeCount
impl Ord for NodeCount
Source§impl PartialOrd for NodeCount
impl PartialOrd for NodeCount
Source§impl SubAssign for NodeCount
impl SubAssign for NodeCount
Source§fn sub_assign(&mut self, rhs: NodeCount)
fn sub_assign(&mut self, rhs: NodeCount)
Performs the
-=
operation. Read moreimpl Copy for NodeCount
impl Eq for NodeCount
impl StructuralPartialEq for NodeCount
Auto Trait Implementations§
impl Freeze for NodeCount
impl RefUnwindSafe for NodeCount
impl Send for NodeCount
impl Sync for NodeCount
impl Unpin for NodeCount
impl UnwindSafe for NodeCount
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more