Trait Coordinator

Source
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§

Source

type Index

Index is the type used to identify a particular set of sequencers and signers.

Source

type PublicKey: Array

PublicKey is the type used to identify a sequencer or signer.

Required Methods§

Source

fn index(&self) -> Self::Index

Returns the current index of the coordinator.

Source

fn sequencers(&self, index: Self::Index) -> Option<&Vec<Self::PublicKey>>

Get the sorted sequencers for the given Index.

Source

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.

Source

fn signers(&self, index: Self::Index) -> Option<&Vec<Self::PublicKey>>

Get the sorted signers for the given Index.

Source

fn is_signer( &self, index: Self::Index, candidate: &Self::PublicKey, ) -> Option<u32>

Returns the index of the signer (in the list of sorted signers) if the candidate is a signer 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.

Implementors§