Struct pallet_collective::Prime [−][src]
pub struct Prime<T: Config<I>, I: Instance = DefaultInstance>(_);
Expand description
The prime member that helps determine the default vote behavior in case of absentations.
Trait Implementations
Module prefix. Used for generating final key.
Storage prefix. Used for generating final key.
Convert an optional value retrieved from storage to the type queried.
Convert a query to an optional value into storage.
Generate the full key used in top storage.
Auto Trait Implementations
impl<T, I> RefUnwindSafe for Prime<T, I> where
I: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, I> UnwindSafe for Prime<T, I> where
I: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
impl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: Any,
Convert Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
. Read more
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read more
Convert &Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read more
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert &mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
type Output = T
type Output = T
Should always be Self
type Query = <G as StorageValue<T>>::Query
type Query = <G as StorageValue<T>>::Query
The type that get/take return.
Get the storage key.
Load the value from the provided storage instance.
Try to get the underlying value from the provided storage instance. Read more
Translate a value from some previous type (O
) to the current type. Read more
Store a value under this key into the provided storage instance.
Store a value under this key into the provided storage instance; this uses the query type rather than the underlying value. Read more
Mutate the value
pub fn try_mutate<R, E, F>(f: F) -> Result<R, E> where
F: FnOnce(&mut <G as StorageValue<T>>::Query) -> Result<R, E>,
pub fn try_mutate<R, E, F>(f: F) -> Result<R, E> where
F: FnOnce(&mut <G as StorageValue<T>>::Query) -> Result<R, E>,
Mutate the value if closure returns Ok
Take a value from storage, removing it afterwards.
pub fn append<Item, EncodeLikeItem>(item: EncodeLikeItem) where
T: StorageAppend<Item>,
Item: Encode,
EncodeLikeItem: EncodeLike<Item>,
pub fn append<Item, EncodeLikeItem>(item: EncodeLikeItem) where
T: StorageAppend<Item>,
Item: Encode,
EncodeLikeItem: EncodeLike<Item>,
Append the given item to the value in the storage. Read more
Read the length of the storage value without decoding the entire value. Read more
The inverse inclusion map: attempts to construct self
from the equivalent element of its
superset. Read more
pub fn is_in_subset(&self) -> bool
pub fn is_in_subset(&self) -> bool
Checks if self
is actually part of its subset T
(and can be converted to it).
pub fn to_subset_unchecked(&self) -> SS
pub fn to_subset_unchecked(&self) -> SS
Use with care! Same as self.to_subset
but without any property checks. Always succeeds.
pub fn from_subset(element: &SS) -> SP
pub fn from_subset(element: &SS) -> SP
The inclusion map: converts self
to the equivalent element of its superset.
impl<T, I, StorageValueT> TryAppendValue<T, I> for StorageValueT where
I: Encode,
T: FullCodec + StorageTryAppend<I>,
StorageValueT: StorageValue<T>,
impl<T, I, StorageValueT> TryAppendValue<T, I> for StorageValueT where
I: Encode,
T: FullCodec + StorageTryAppend<I>,
StorageValueT: StorageValue<T>,
The counterpart to unchecked_from
.
Consume self to return an equivalent value of T
.
pub fn vzip(self) -> V