pub trait Coordinator:
Clone
+ Send
+ Sync
+ 'static {
type Index;
type PublicKey: Array;
// Required methods
fn index(&self) -> Self::Index;
fn sequencers(&self, index: Self::Index) -> Option<&Vec<Self::PublicKey>>;
fn is_sequencer(
&self,
index: Self::Index,
candidate: &Self::PublicKey,
) -> Option<u32>;
fn signers(&self, index: Self::Index) -> Option<&Vec<Self::PublicKey>>;
fn is_signer(
&self,
index: Self::Index,
candidate: &Self::PublicKey,
) -> Option<u32>;
}Expand description
Coordinator is the interface responsible for managing the active set of sequencers and signers.
It is up to the user to ensure changes in this list are synchronized across nodes in the network
at a given Index. Otherwise, “acknowledgement” of a payload by the network may be delayed or never occur.
Required Associated Types§
Required Methods§
Sourcefn sequencers(&self, index: Self::Index) -> Option<&Vec<Self::PublicKey>>
fn sequencers(&self, index: Self::Index) -> Option<&Vec<Self::PublicKey>>
Get the sorted sequencers for the given Index.
Sourcefn is_sequencer(
&self,
index: Self::Index,
candidate: &Self::PublicKey,
) -> Option<u32>
fn is_sequencer( &self, index: Self::Index, candidate: &Self::PublicKey, ) -> Option<u32>
Returns the index of the sequencer (in the list of sorted sequencers) if the candidate is a sequencer at the given Index.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.