Struct fbas_analyzer::Groupings
source · 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§
source§impl<'fbas> PartialEq for Groupings<'fbas>
impl<'fbas> PartialEq for Groupings<'fbas>
impl<'fbas> Eq for Groupings<'fbas>
impl<'fbas> StructuralEq for Groupings<'fbas>
impl<'fbas> StructuralPartialEq for Groupings<'fbas>
Auto Trait Implementations§
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<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.