Struct pallet_ovm::Games [−][src]
pub struct Games<T: Config>(_);
Expand description
Mapping the game id to Challenge Game.
Trait Implementations
impl<T: Config> StorageMap<<T as Config>::Hash, ChallengeGame<<T as Config>::Hash, <T as Config>::BlockNumber>> for Games<T>
impl<T: Config> StorageMap<<T as Config>::Hash, ChallengeGame<<T as Config>::Hash, <T as Config>::BlockNumber>> for Games<T>
type Query = Option<ChallengeGame<<T as Config>::Hash, <T as Config>::BlockNumber>>
type Query = Option<ChallengeGame<<T as Config>::Hash, <T as Config>::BlockNumber>>
The type that get/take returns.
type Hasher = Blake2_128Concat
type Hasher = Blake2_128Concat
Hasher. Used for generating final key.
Module prefix. Used for generating final key.
Storage prefix. Used for generating final key.
fn from_optional_value_to_query(
v: Option<ChallengeGame<<T as Config>::Hash, <T as Config>::BlockNumber>>
) -> Self::Query
fn from_optional_value_to_query(
v: Option<ChallengeGame<<T as Config>::Hash, <T as Config>::BlockNumber>>
) -> Self::Query
Convert an optional value retrieved from storage to the type queried.
fn from_query_to_optional_value(
v: Self::Query
) -> Option<ChallengeGame<<T as Config>::Hash, <T as Config>::BlockNumber>>
fn from_query_to_optional_value(
v: Self::Query
) -> Option<ChallengeGame<<T as Config>::Hash, <T as Config>::BlockNumber>>
Convert a query to an optional value into storage.
The full prefix; just the hash of module_prefix
concatenated to the hash of
storage_prefix
. Read more
Generate the full key used in top storage.
impl<T: Config> StoragePrefixedMap<ChallengeGame<<T as Config>::Hash, <T as Config>::BlockNumber>> for Games<T>
impl<T: Config> StoragePrefixedMap<ChallengeGame<<T as Config>::Hash, <T as Config>::BlockNumber>> for Games<T>
Module prefix. Used for generating final key.
Storage prefix. Used for generating final key.
Final full prefix that prefixes all keys.
Remove all value of the storage.
Iter over all value of the storage. Read more
Auto Trait Implementations
impl<T> RefUnwindSafe for Games<T> where
T: RefUnwindSafe,
impl<T> UnwindSafe for Games<T> where
T: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. 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 StorageMap<K, V>>::Query
type Query = <G as StorageMap<K, V>>::Query
The type that get/take return.
Get the storage key used to fetch a value corresponding to a specific key.
pub fn swap<KeyArg1, KeyArg2>(key1: KeyArg1, key2: KeyArg2) where
KeyArg1: EncodeLike<K>,
KeyArg2: EncodeLike<K>,
pub fn swap<KeyArg1, KeyArg2>(key1: KeyArg1, key2: KeyArg2) where
KeyArg1: EncodeLike<K>,
KeyArg2: EncodeLike<K>,
Swap the values of two keys.
Does the value (explicitly) exist in storage?
Load the value associated with the given key from the map.
Try to get the value for the given key from the map. Read more
pub fn insert<KeyArg, ValArg>(key: KeyArg, val: ValArg) where
KeyArg: EncodeLike<K>,
ValArg: EncodeLike<V>,
pub fn insert<KeyArg, ValArg>(key: KeyArg, val: ValArg) where
KeyArg: EncodeLike<K>,
ValArg: EncodeLike<V>,
Store a value to be associated with the given key from the map.
Remove the value under a key.
pub fn mutate<KeyArg, R, F>(key: KeyArg, f: F) -> R where
F: FnOnce(&mut <G as StorageMap<K, V>>::Query) -> R,
KeyArg: EncodeLike<K>,
pub fn mutate<KeyArg, R, F>(key: KeyArg, f: F) -> R where
F: FnOnce(&mut <G as StorageMap<K, V>>::Query) -> R,
KeyArg: EncodeLike<K>,
Mutate the value under a key.
pub fn mutate_exists<KeyArg, R, F>(key: KeyArg, f: F) -> R where
F: FnOnce(&mut Option<V>) -> R,
KeyArg: EncodeLike<K>,
pub fn mutate_exists<KeyArg, R, F>(key: KeyArg, f: F) -> R where
F: FnOnce(&mut Option<V>) -> R,
KeyArg: EncodeLike<K>,
Mutate the value under a key. Read more
pub fn try_mutate<KeyArg, R, E, F>(key: KeyArg, f: F) -> Result<R, E> where
F: FnOnce(&mut <G as StorageMap<K, V>>::Query) -> Result<R, E>,
KeyArg: EncodeLike<K>,
pub fn try_mutate<KeyArg, R, E, F>(key: KeyArg, f: F) -> Result<R, E> where
F: FnOnce(&mut <G as StorageMap<K, V>>::Query) -> Result<R, E>,
KeyArg: EncodeLike<K>,
Mutate the item, only if an Ok
value is returned.
pub fn try_mutate_exists<KeyArg, R, E, F>(key: KeyArg, f: F) -> Result<R, E> where
F: FnOnce(&mut Option<V>) -> Result<R, E>,
KeyArg: EncodeLike<K>,
pub fn try_mutate_exists<KeyArg, R, E, F>(key: KeyArg, f: F) -> Result<R, E> where
F: FnOnce(&mut Option<V>) -> Result<R, E>,
KeyArg: EncodeLike<K>,
Mutate the item, only if an Ok
value is returned. Deletes the item if mutated to a None
.
pub fn take<KeyArg>(key: KeyArg) -> <G as StorageMap<K, V>>::Query where
KeyArg: EncodeLike<K>,
pub fn take<KeyArg>(key: KeyArg) -> <G as StorageMap<K, V>>::Query where
KeyArg: EncodeLike<K>,
Take the value under a key.
pub fn append<Item, EncodeLikeItem, EncodeLikeKey>(
key: EncodeLikeKey,
item: EncodeLikeItem
) where
Item: Encode,
V: StorageAppend<Item>,
EncodeLikeItem: EncodeLike<Item>,
EncodeLikeKey: EncodeLike<K>,
pub fn append<Item, EncodeLikeItem, EncodeLikeKey>(
key: EncodeLikeKey,
item: EncodeLikeItem
) where
Item: Encode,
V: StorageAppend<Item>,
EncodeLikeItem: EncodeLike<Item>,
EncodeLikeKey: EncodeLike<K>,
Append the given items to the value in the storage. Read more
pub fn migrate_key<OldHasher, KeyArg>(key: KeyArg) -> Option<V> where
KeyArg: EncodeLike<K>,
OldHasher: StorageHasher,
pub fn migrate_key<OldHasher, KeyArg>(key: KeyArg) -> Option<V> where
KeyArg: EncodeLike<K>,
OldHasher: StorageHasher,
Migrate an item with the given key
from a defunct OldHasher
to the current hasher. Read more
fn decode_len<KeyArg>(key: KeyArg) -> Option<usize> where
V: StorageDecodeLength,
KeyArg: EncodeLike<K>,
fn decode_len<KeyArg>(key: KeyArg) -> Option<usize> where
V: StorageDecodeLength,
KeyArg: EncodeLike<K>,
Read the length of the storage value without decoding the entire value under the
given key
. Read more
Migrate an item with the given key
from a blake2_256
hasher to the current hasher. Read more
The counterpart to unchecked_from
.
Consume self to return an equivalent value of T
.
pub fn vzip(self) -> V
impl<T> MaybeRefUnwindSafe for T where
T: RefUnwindSafe,