pub trait TracksInfo<Balance, Moment, const N: usize = DEFAULT_MAX_TRACK_NAME_LEN>{
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§
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§
Provided Methods§
Sourcefn track_ids() -> impl Iterator<Item = Self::Id>
fn track_ids() -> impl Iterator<Item = Self::Id>
Return the list of identifiers of the known tracks.
Sourcefn info(id: Self::Id) -> Option<Cow<'static, TrackInfo<Balance, Moment, N>>>
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()
.
Sourcefn check_integrity() -> Result<(), &'static str>
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.