iota_types::committee

Trait CommitteeTrait

Source
pub trait CommitteeTrait<K: Ord> {
    // Required methods
    fn shuffle_by_stake_with_rng(
        &self,
        preferences: Option<&BTreeSet<K>>,
        restrict_to: Option<&BTreeSet<K>>,
        rng: &mut impl Rng,
    ) -> Vec<K>;
    fn weight(&self, author: &K) -> StakeUnit;

    // Provided method
    fn shuffle_by_stake(
        &self,
        preferences: Option<&BTreeSet<K>>,
        restrict_to: Option<&BTreeSet<K>>,
    ) -> Vec<K> { ... }
}

Required Methods§

Source

fn shuffle_by_stake_with_rng( &self, preferences: Option<&BTreeSet<K>>, restrict_to: Option<&BTreeSet<K>>, rng: &mut impl Rng, ) -> Vec<K>

Source

fn weight(&self, author: &K) -> StakeUnit

Provided Methods§

Source

fn shuffle_by_stake( &self, preferences: Option<&BTreeSet<K>>, restrict_to: Option<&BTreeSet<K>>, ) -> Vec<K>

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§