Struct narwhal_config::WorkerCache
source · [−]pub struct WorkerCache {
pub workers: BTreeMap<PublicKey, WorkerIndex>,
pub epoch: Epoch,
}
Fields
workers: BTreeMap<PublicKey, WorkerIndex>
The authority to worker index.
epoch: Epoch
The epoch number for workers
Implementations
sourceimpl WorkerCache
impl WorkerCache
sourcepub fn worker(
&self,
to: &PublicKey,
id: &WorkerId
) -> Result<WorkerInfo, ConfigError>
pub fn worker(
&self,
to: &PublicKey,
id: &WorkerId
) -> Result<WorkerInfo, ConfigError>
Returns the addresses of a specific worker (id
) of a specific authority (to
).
sourcepub fn our_workers(
&self,
myself: &PublicKey
) -> Result<Vec<WorkerInfo>, ConfigError>
pub fn our_workers(
&self,
myself: &PublicKey
) -> Result<Vec<WorkerInfo>, ConfigError>
Returns the addresses of all our workers.
sourcepub fn all_workers(&self) -> Vec<(NetworkPublicKey, Multiaddr)>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
pub fn all_workers(&self) -> Vec<(NetworkPublicKey, Multiaddr)>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
A: Allocator,
Returns the addresses of all known workers.
sourcepub fn others_workers(
&self,
myself: &PublicKey,
id: &WorkerId
) -> Vec<(PublicKey, WorkerInfo)>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
pub fn others_workers(
&self,
myself: &PublicKey,
id: &WorkerId
) -> Vec<(PublicKey, WorkerInfo)>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
A: Allocator,
Returns the addresses of all workers with a specific id except the ones of the authority
specified by myself
.
sourcepub fn network_diff(&self, keys: Vec<&PublicKey>) -> HashSet<&Multiaddr>
pub fn network_diff(&self, keys: Vec<&PublicKey>) -> HashSet<&Multiaddr>
Return the network addresses that are present in the current worker cache that are from a primary key that are no longer in the committee. Current committee keys provided as an argument.
Trait Implementations
sourceimpl Clone for WorkerCache
impl Clone for WorkerCache
sourcefn clone(&self) -> WorkerCache
fn clone(&self) -> WorkerCache
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for WorkerCache
impl Debug for WorkerCache
sourceimpl<'de> Deserialize<'de> for WorkerCache
impl<'de> Deserialize<'de> for WorkerCache
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl Display for WorkerCache
impl Display for WorkerCache
sourcefn from(worker_cache: WorkerCache) -> Self
fn from(worker_cache: WorkerCache) -> Self
Converts to this type from the input type.
sourceimpl Serialize for WorkerCache
impl Serialize for WorkerCache
Auto Trait Implementations
impl RefUnwindSafe for WorkerCache
impl Send for WorkerCache
impl Sync for WorkerCache
impl Unpin for WorkerCache
impl UnwindSafe for WorkerCache
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more