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>

source

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.

source

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.

source

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.

source

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).

source

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

pub fn merge_quorum_sets(&self, quorum_set: Vec<QuorumSet>) -> Vec<QuorumSet>

calls merge_quorum_set on each vector element

source§

impl<'fbas> Groupings<'fbas>

source

pub fn get_by_member(&self, node_id: NodeId) -> Option<&Grouping>

source

pub fn get_by_name(&self, name: &str) -> Option<&Grouping>

source

pub fn number_of_groupings(&self) -> usize

source§

impl<'fbas> Groupings<'fbas>

source

pub fn shrunken( orgs: &Self, shrink_manager: &ShrinkManager, shrunken_fbas: &'fbas Fbas ) -> Self

source§

impl<'fbas> Groupings<'fbas>

source

pub fn from_json_str(json: &str, fbas: &'fbas Fbas) -> Self

source

pub fn organizations_from_json_str(orgs_json: &str, fbas: &'fbas Fbas) -> Self

source

pub fn isps_from_json_str(nodes_json: &str, fbas: &'fbas Fbas) -> Self

source

pub fn countries_from_json_str(nodes_json: &str, fbas: &'fbas Fbas) -> Self

source

pub fn from_json_file(path: &Path, fbas: &'fbas Fbas) -> Self

source

pub fn organizations_from_json_file(path: &Path, fbas: &'fbas Fbas) -> Self

source

pub fn isps_from_json_file(path: &Path, fbas: &'fbas Fbas) -> Self

source

pub fn countries_from_json_file(path: &Path, fbas: &'fbas Fbas) -> Self

Trait Implementations§

source§

impl<'fbas> Clone for Groupings<'fbas>

source§

fn clone(&self) -> Groupings<'fbas>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'fbas> Debug for Groupings<'fbas>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'fbas> PartialEq for Groupings<'fbas>

source§

fn eq(&self, other: &Groupings<'fbas>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<'fbas> Serialize for Groupings<'fbas>

source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl<'fbas> Eq for Groupings<'fbas>

source§

impl<'fbas> StructuralEq for Groupings<'fbas>

source§

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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.