referrerpolicy=no-referrer-when-downgrade
pallet_referenda

Trait TracksInfo

Source
pub trait TracksInfo<Balance, Moment, const N: usize = DEFAULT_MAX_TRACK_NAME_LEN>
where Balance: Clone + Debug + Eq + 'static, Moment: Clone + Debug + Eq + 'static,
{ type Id: Copy + Parameter + Ord + PartialOrd + Send + Sync + 'static + MaxEncodedLen; type RuntimeOrigin; // Required methods fn tracks( ) -> impl Iterator<Item = Cow<'static, Track<Self::Id, Balance, Moment, N>>>; fn track_for(origin: &Self::RuntimeOrigin) -> Result<Self::Id, ()>; // Provided methods fn track_ids() -> impl Iterator<Item = Self::Id> { ... } fn info(id: Self::Id) -> Option<Cow<'static, TrackInfo<Balance, Moment, N>>> { ... } fn check_integrity() -> Result<(), &'static str> { ... } }
Expand description

Information on the voting tracks.

Required Associated Types§

Source

type Id: Copy + Parameter + Ord + PartialOrd + Send + Sync + 'static + MaxEncodedLen

The identifier for a track.

Source

type RuntimeOrigin

The origin type from which a track is implied.

Required Methods§

Source

fn tracks() -> impl Iterator<Item = Cow<'static, Track<Self::Id, Balance, Moment, N>>>

Return the sorted iterable list of known tracks and their information.

The iterator MUST be sorted by Id. Consumers of this trait are advised to assert Self::check_integrity prior to any use.

Source

fn track_for(origin: &Self::RuntimeOrigin) -> Result<Self::Id, ()>

Determine the voting track for the given origin.

Provided Methods§

Source

fn track_ids() -> impl Iterator<Item = Self::Id>

Return the list of identifiers of the known tracks.

Source

fn info(id: Self::Id) -> Option<Cow<'static, TrackInfo<Balance, Moment, N>>>

Return the track info for track id, by default this just looks it up in Self::tracks().

Source

fn check_integrity() -> Result<(), &'static str>

Check assumptions about the static data that this trait provides.

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§