Trait frame_support::traits::RankedMembers
source · pub trait RankedMembers {
type AccountId;
type Rank: AtLeast16BitUnsigned;
// Required methods
fn min_rank() -> Self::Rank;
fn rank_of(who: &Self::AccountId) -> Option<Self::Rank>;
fn induct(who: &Self::AccountId) -> DispatchResult;
fn promote(who: &Self::AccountId) -> DispatchResult;
fn demote(who: &Self::AccountId) -> DispatchResult;
}
Expand description
Ranked membership data structure.
Required Associated Types§
type AccountId
type Rank: AtLeast16BitUnsigned
Required Methods§
sourcefn rank_of(who: &Self::AccountId) -> Option<Self::Rank>
fn rank_of(who: &Self::AccountId) -> Option<Self::Rank>
Return the rank of the given ID, or None
if they are not a member.
sourcefn induct(who: &Self::AccountId) -> DispatchResult
fn induct(who: &Self::AccountId) -> DispatchResult
Add a member to the group at the min_rank()
.
sourcefn promote(who: &Self::AccountId) -> DispatchResult
fn promote(who: &Self::AccountId) -> DispatchResult
Promote a member to the next higher rank.
sourcefn demote(who: &Self::AccountId) -> DispatchResult
fn demote(who: &Self::AccountId) -> DispatchResult
Demote a member to the next lower rank; demoting beyond the min_rank
removes the
member entirely.