Trait pallet_referenda::TracksInfo
source · pub trait TracksInfo<Balance, Moment> {
type Id: Copy + Parameter + Ord + PartialOrd + Send + Sync + 'static + MaxEncodedLen;
type RuntimeOrigin;
// Required methods
fn tracks() -> &'static [(Self::Id, TrackInfo<Balance, Moment>)];
fn track_for(origin: &Self::RuntimeOrigin) -> Result<Self::Id, ()>;
// Provided methods
fn info(id: Self::Id) -> Option<&'static TrackInfo<Balance, Moment>> { ... }
fn check_integrity() -> Result<(), &'static str>
where Balance: 'static,
Moment: 'static { ... }
}
Expand description
Information on the voting tracks.
Required Associated Types§
sourcetype Id: Copy + Parameter + Ord + PartialOrd + Send + Sync + 'static + MaxEncodedLen
type Id: Copy + Parameter + Ord + PartialOrd + Send + Sync + 'static + MaxEncodedLen
The identifier for a track.
sourcetype RuntimeOrigin
type RuntimeOrigin
The origin type from which a track is implied.
Required Methods§
sourcefn tracks() -> &'static [(Self::Id, TrackInfo<Balance, Moment>)]
fn tracks() -> &'static [(Self::Id, TrackInfo<Balance, Moment>)]
Sorted array of known tracks and their information.
The array MUST be sorted by Id
. Consumers of this trait are advised to assert
Self::check_integrity
prior to any use.
Provided Methods§
sourcefn info(id: Self::Id) -> Option<&'static TrackInfo<Balance, Moment>>
fn info(id: Self::Id) -> Option<&'static TrackInfo<Balance, Moment>>
Return the track info for track id
, by default this just looks it up in Self::tracks()
.
sourcefn check_integrity() -> Result<(), &'static str>where
Balance: 'static,
Moment: 'static,
fn check_integrity() -> Result<(), &'static str>where
Balance: 'static,
Moment: 'static,
Check assumptions about the static data that this trait provides.
Object Safety§
This trait is not object safe.