pub struct Groupings<'fbas> { /* private fields */ }Expand description
Defines one concrete way to group the nodes of an Fbas, for example by organization, ISP or
country. Used for merging nodes belonging to the same group into one.
Implementations§
Source§impl<'fbas> Groupings<'fbas>
impl<'fbas> Groupings<'fbas>
Sourcepub fn merge_node(&self, node_id: NodeId) -> NodeId
pub fn merge_node(&self, node_id: NodeId) -> NodeId
Merge a node ID so that all nodes by the same grouping get the same ID.
Sourcepub fn merge_node_set(&self, node_set: NodeIdSet) -> NodeIdSet
pub fn merge_node_set(&self, node_set: NodeIdSet) -> NodeIdSet
Merge a node ID set so that all nodes by the same grouping get the same ID.
Sourcepub fn merge_node_sets(&self, node_sets: Vec<NodeIdSet>) -> Vec<NodeIdSet> ⓘ
pub fn merge_node_sets(&self, node_sets: Vec<NodeIdSet>) -> Vec<NodeIdSet> ⓘ
Merge a list of node ID sets so that all nodes by the same grouping get the same ID.
Sourcepub fn merge_minimal_node_sets(
&self,
node_sets: Vec<NodeIdSet>,
) -> Vec<NodeIdSet> ⓘ
pub fn merge_minimal_node_sets( &self, node_sets: Vec<NodeIdSet>, ) -> Vec<NodeIdSet> ⓘ
Merge a list of node ID sets so that all nodes by the same grouping get the same ID and the returned node sets are all minimal w.r.t. each other (none is a superset of another).
Sourcepub fn merge_quorum_set(&self, quorum_set: QuorumSet) -> QuorumSet
pub fn merge_quorum_set(&self, quorum_set: QuorumSet) -> QuorumSet
Merge a quorum set so that all nodes by the same grouping get the same ID and validator lists consisting of only of one grouping are collapsed into one validator.
Source§impl<'fbas> Groupings<'fbas>
impl<'fbas> Groupings<'fbas>
pub fn get_by_member(&self, node_id: NodeId) -> Option<&Grouping>
pub fn get_by_name(&self, name: &str) -> Option<&Grouping>
pub fn number_of_groupings(&self) -> usize
Source§impl<'fbas> Groupings<'fbas>
impl<'fbas> Groupings<'fbas>
pub fn from_json_str(json: &str, fbas: &'fbas Fbas) -> Self
pub fn organizations_from_json_str(orgs_json: &str, fbas: &'fbas Fbas) -> Self
pub fn isps_from_json_str(nodes_json: &str, fbas: &'fbas Fbas) -> Self
pub fn countries_from_json_str(nodes_json: &str, fbas: &'fbas Fbas) -> Self
pub fn from_json_file(path: &Path, fbas: &'fbas Fbas) -> Self
pub fn organizations_from_json_file(path: &Path, fbas: &'fbas Fbas) -> Self
pub fn isps_from_json_file(path: &Path, fbas: &'fbas Fbas) -> Self
pub fn countries_from_json_file(path: &Path, fbas: &'fbas Fbas) -> Self
Trait Implementations§
impl<'fbas> Eq for Groupings<'fbas>
impl<'fbas> StructuralPartialEq for Groupings<'fbas>
Auto Trait Implementations§
impl<'fbas> Freeze for Groupings<'fbas>
impl<'fbas> RefUnwindSafe for Groupings<'fbas>
impl<'fbas> Send for Groupings<'fbas>
impl<'fbas> Sync for Groupings<'fbas>
impl<'fbas> Unpin for Groupings<'fbas>
impl<'fbas> UnwindSafe for Groupings<'fbas>
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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