pub trait NonEpochMembershipSnapshot<T: NodeType>:
Clone
+ Send
+ Sync {
type Error: Error + Send + Sync + 'static;
Show 18 methods
// Required methods
fn stake_table(
&self,
) -> impl ExactSizeIterator<Item = &PeerConfig<T>> + Send + '_;
fn da_stake_table(
&self,
) -> impl ExactSizeIterator<Item = &PeerConfig<T>> + Send + '_;
fn committee_members(
&self,
view: ViewNumber,
) -> impl ExactSizeIterator<Item = &T::SignatureKey> + Send + '_;
fn da_committee_members(
&self,
view: ViewNumber,
) -> impl ExactSizeIterator<Item = &T::SignatureKey> + Send + '_;
fn stake(&self, key: &T::SignatureKey) -> Option<PeerConfig<T>>;
fn da_stake(&self, key: &T::SignatureKey) -> Option<PeerConfig<T>>;
fn has_stake(&self, key: &T::SignatureKey) -> bool;
fn has_da_stake(&self, key: &T::SignatureKey) -> bool;
fn lookup_leader(
&self,
view: ViewNumber,
) -> Result<T::SignatureKey, Self::Error>;
// Provided methods
fn total_nodes(&self) -> usize { ... }
fn da_total_nodes(&self) -> usize { ... }
fn total_stake(&self) -> U256 { ... }
fn total_da_stake(&self) -> U256 { ... }
fn success_threshold(&self) -> U256 { ... }
fn da_success_threshold(&self) -> U256 { ... }
fn failure_threshold(&self) -> U256 { ... }
fn upgrade_threshold(&self) -> U256 { ... }
fn leader(&self, view: ViewNumber) -> Result<T::SignatureKey> { ... }
}Expand description
A consistent view of the pre-epoch Membership state.
Used when consensus is operating before epochs are enabled (the
epoch == None path in the legacy API).
Required Associated Types§
Required Methods§
fn stake_table( &self, ) -> impl ExactSizeIterator<Item = &PeerConfig<T>> + Send + '_
fn da_stake_table( &self, ) -> impl ExactSizeIterator<Item = &PeerConfig<T>> + Send + '_
fn committee_members( &self, view: ViewNumber, ) -> impl ExactSizeIterator<Item = &T::SignatureKey> + Send + '_
fn da_committee_members( &self, view: ViewNumber, ) -> impl ExactSizeIterator<Item = &T::SignatureKey> + Send + '_
fn stake(&self, key: &T::SignatureKey) -> Option<PeerConfig<T>>
fn da_stake(&self, key: &T::SignatureKey) -> Option<PeerConfig<T>>
fn has_stake(&self, key: &T::SignatureKey) -> bool
fn has_da_stake(&self, key: &T::SignatureKey) -> bool
fn lookup_leader( &self, view: ViewNumber, ) -> Result<T::SignatureKey, Self::Error>
Provided Methods§
fn total_nodes(&self) -> usize
fn da_total_nodes(&self) -> usize
fn total_stake(&self) -> U256
fn total_da_stake(&self) -> U256
fn success_threshold(&self) -> U256
fn da_success_threshold(&self) -> U256
fn failure_threshold(&self) -> U256
fn upgrade_threshold(&self) -> U256
fn leader(&self, view: ViewNumber) -> Result<T::SignatureKey>
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.