Trait sn_routing::SectionAuthorityProviderUtils [−][src]
pub trait SectionAuthorityProviderUtils { fn new<I: IntoIterator<Item = Peer>>(
elders: I,
prefix: Prefix,
pk_set: ReplicaPublicKeySet
) -> Self; fn from_elder_candidates(
elder_candidates: ElderCandidates,
pk_set: ReplicaPublicKeySet
) -> SectionAuthorityProvider; fn elder_candidates(&self) -> ElderCandidates; fn peers(&self) -> Box<dyn Iterator<Item = Peer>>; fn elder_count(&self) -> usize; fn contains_elder(&self, name: &XorName) -> bool; fn get_addr(&self, name: &XorName) -> Option<SocketAddr>; fn names(&self) -> BTreeSet<XorName>; fn elders(&self) -> BTreeMap<XorName, SocketAddr>; fn addresses(&self) -> Vec<SocketAddr>; fn prefix(&self) -> Prefix; fn section_key(&self) -> PublicKey; }
A new SectionAuthorityProvider
is created whenever the elders change,
due to an elder being added or removed, or the section splitting or merging.
Required methods
fn new<I: IntoIterator<Item = Peer>>(
elders: I,
prefix: Prefix,
pk_set: ReplicaPublicKeySet
) -> Self
[src]
elders: I,
prefix: Prefix,
pk_set: ReplicaPublicKeySet
) -> Self
Creates a new SectionAuthorityProvider
with the given members, prefix and public keyset.
fn from_elder_candidates(
elder_candidates: ElderCandidates,
pk_set: ReplicaPublicKeySet
) -> SectionAuthorityProvider
[src]
elder_candidates: ElderCandidates,
pk_set: ReplicaPublicKeySet
) -> SectionAuthorityProvider
Creates a new SectionAuthorityProvider
from ElderCandidates and public keyset.
fn elder_candidates(&self) -> ElderCandidates
[src]
Returns ElderCandidates
, which doesn’t have key related infos.
fn peers(&self) -> Box<dyn Iterator<Item = Peer>>
[src]
Returns an iterator to the list of peers.
fn elder_count(&self) -> usize
[src]
Returns the number of elders in the section.
fn contains_elder(&self, name: &XorName) -> bool
[src]
Returns a map of name to socket_addr.
fn get_addr(&self, name: &XorName) -> Option<SocketAddr>
[src]
Returns a socket_addr of an elder.
fn names(&self) -> BTreeSet<XorName>
[src]
Returns the set of elder names.
fn elders(&self) -> BTreeMap<XorName, SocketAddr>
[src]
Returns a map of name to socket_addr.
fn addresses(&self) -> Vec<SocketAddr>
[src]
Returns the list of socket addresses.
fn prefix(&self) -> Prefix
[src]
Returns its prefix.
fn section_key(&self) -> PublicKey
[src]
Key of the section.
Implementations on Foreign Types
impl SectionAuthorityProviderUtils for SectionAuthorityProvider
[src]
impl SectionAuthorityProviderUtils for SectionAuthorityProvider
[src]fn new<I>(elders: I, prefix: Prefix, pk_set: ReplicaPublicKeySet) -> Self where
I: IntoIterator<Item = Peer>,
[src]
I: IntoIterator<Item = Peer>,
Creates a new SectionAuthorityProvider
with the given members, prefix and public keyset.
fn from_elder_candidates(
elder_candidates: ElderCandidates,
pk_set: ReplicaPublicKeySet
) -> SectionAuthorityProvider
[src]
elder_candidates: ElderCandidates,
pk_set: ReplicaPublicKeySet
) -> SectionAuthorityProvider
Creates a new SectionAuthorityProvider
from ElderCandidates and public keyset.
fn elder_candidates(&self) -> ElderCandidates
[src]
Returns ElderCandidates
, which doesn’t have key related infos.
fn peers(&self) -> Box<dyn Iterator<Item = Peer>>
[src]
fn elder_count(&self) -> usize
[src]
Returns the number of elders in the section.
fn contains_elder(&self, name: &XorName) -> bool
[src]
Returns a map of name to socket_addr.
fn get_addr(&self, name: &XorName) -> Option<SocketAddr>
[src]
Returns a socket_addr of an elder.
fn names(&self) -> BTreeSet<XorName>
[src]
Returns the set of elder names.
fn elders(&self) -> BTreeMap<XorName, SocketAddr>
[src]
Returns a map of name to socket_addr.
fn addresses(&self) -> Vec<SocketAddr>
[src]
fn prefix(&self) -> Prefix
[src]
fn section_key(&self) -> PublicKey
[src]
Key of the section.