Struct governance_os_pallet_tokens::Balances [−][src]
pub struct Balances<T: Config>(_);
Store the balances holded by an account. By storing the balances under an account (VS storing the accounts under the currency ids) we can enumerate the tokens holded by an account if needed.
Trait Implementations
impl<T: Config> StorageDoubleMap<<T as Config>::AccountId, <T as Config>::CurrencyId, AccountCurrencyData<<T as Config>::Balance>> for Balances<T>
[src]
impl<T: Config> StorageDoubleMap<<T as Config>::AccountId, <T as Config>::CurrencyId, AccountCurrencyData<<T as Config>::Balance>> for Balances<T>
[src]type Query = AccountCurrencyData<T::Balance>
The type that get/take returns.
type Hasher1 = Blake2_128Concat
Hasher for the first key.
type Hasher2 = Blake2_128Concat
Hasher for the second key.
fn module_prefix() -> &'static [u8]
[src]
fn storage_prefix() -> &'static [u8]
[src]
fn from_optional_value_to_query(
v: Option<AccountCurrencyData<T::Balance>>
) -> Self::Query
[src]
v: Option<AccountCurrencyData<T::Balance>>
) -> Self::Query
fn from_query_to_optional_value(
v: Self::Query
) -> Option<AccountCurrencyData<T::Balance>>
[src]
v: Self::Query
) -> Option<AccountCurrencyData<T::Balance>>
pub fn prefix_hash() -> Vec<u8, Global>
[src]
pub fn storage_double_map_final_key1<KArg1>(k1: KArg1) -> Vec<u8, Global> where
KArg1: EncodeLike<K1>,
[src]
KArg1: EncodeLike<K1>,
pub fn storage_double_map_final_key<KArg1, KArg2>(
k1: KArg1,
k2: KArg2
) -> Vec<u8, Global> where
KArg1: EncodeLike<K1>,
KArg2: EncodeLike<K2>,
[src]
k1: KArg1,
k2: KArg2
) -> Vec<u8, Global> where
KArg1: EncodeLike<K1>,
KArg2: EncodeLike<K2>,
impl<T: Config> StoragePrefixedMap<AccountCurrencyData<<T as Config>::Balance>> for Balances<T>
[src]
impl<T: Config> StoragePrefixedMap<AccountCurrencyData<<T as Config>::Balance>> for Balances<T>
[src]fn module_prefix() -> &'static [u8]
[src]
fn storage_prefix() -> &'static [u8]
[src]
pub fn final_prefix() -> [u8; 32]
[src]
pub fn remove_all()
[src]
pub fn iter_values() -> PrefixIterator<Value>
[src]
pub fn translate_values<OldValue, F>(f: F) where
F: FnMut(OldValue) -> Option<Value>,
OldValue: Decode,
[src]
F: FnMut(OldValue) -> Option<Value>,
OldValue: Decode,
Auto Trait Implementations
impl<T> RefUnwindSafe for Balances<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for Balances<T> where
T: Send,
T: Send,
impl<T> Sync for Balances<T> where
T: Sync,
T: Sync,
impl<T> Unpin for Balances<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for Balances<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> CheckedConversion for T
[src]
impl<T> CheckedConversion for T
[src]pub fn checked_from<T>(t: T) -> Option<Self> where
Self: TryFrom<T>,
[src]
Self: TryFrom<T>,
pub fn checked_into<T>(self) -> Option<T> where
Self: TryInto<T>,
[src]
Self: TryInto<T>,
impl<T> Instrument for T
[src]
impl<T> Instrument for T
[src]pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, Outer> IsWrappedBy<Outer> for T where
T: From<Outer>,
Outer: AsRef<T> + AsMut<T> + From<T>,
[src]
impl<T, Outer> IsWrappedBy<Outer> for T where
T: From<Outer>,
Outer: AsRef<T> + AsMut<T> + From<T>,
[src]impl<T> SaturatedConversion for T
[src]
impl<T> SaturatedConversion for T
[src]pub fn saturated_from<T>(t: T) -> Self where
Self: UniqueSaturatedFrom<T>,
[src]
Self: UniqueSaturatedFrom<T>,
pub fn saturated_into<T>(self) -> T where
Self: UniqueSaturatedInto<T>,
[src]
Self: UniqueSaturatedInto<T>,
impl<K1, K2, V, G> StorageDoubleMap<K1, K2, V> for G where
V: FullCodec,
K1: FullEncode,
K2: FullEncode,
G: StorageDoubleMap<K1, K2, V>,
[src]
impl<K1, K2, V, G> StorageDoubleMap<K1, K2, V> for G where
V: FullCodec,
K1: FullEncode,
K2: FullEncode,
G: StorageDoubleMap<K1, K2, V>,
[src]type Query = <G as StorageDoubleMap<K1, K2, V>>::Query
The type that get/take returns.
pub fn hashed_key_for<KArg1, KArg2>(k1: KArg1, k2: KArg2) -> Vec<u8, Global> where
KArg1: EncodeLike<K1>,
KArg2: EncodeLike<K2>,
[src]
KArg1: EncodeLike<K1>,
KArg2: EncodeLike<K2>,
pub fn contains_key<KArg1, KArg2>(k1: KArg1, k2: KArg2) -> bool where
KArg1: EncodeLike<K1>,
KArg2: EncodeLike<K2>,
[src]
KArg1: EncodeLike<K1>,
KArg2: EncodeLike<K2>,
pub fn get<KArg1, KArg2>(
k1: KArg1,
k2: KArg2
) -> <G as StorageDoubleMap<K1, K2, V>>::Query where
KArg1: EncodeLike<K1>,
KArg2: EncodeLike<K2>,
[src]
k1: KArg1,
k2: KArg2
) -> <G as StorageDoubleMap<K1, K2, V>>::Query where
KArg1: EncodeLike<K1>,
KArg2: EncodeLike<K2>,
pub fn try_get<KArg1, KArg2>(k1: KArg1, k2: KArg2) -> Result<V, ()> where
KArg1: EncodeLike<K1>,
KArg2: EncodeLike<K2>,
[src]
KArg1: EncodeLike<K1>,
KArg2: EncodeLike<K2>,
pub fn take<KArg1, KArg2>(
k1: KArg1,
k2: KArg2
) -> <G as StorageDoubleMap<K1, K2, V>>::Query where
KArg1: EncodeLike<K1>,
KArg2: EncodeLike<K2>,
[src]
k1: KArg1,
k2: KArg2
) -> <G as StorageDoubleMap<K1, K2, V>>::Query where
KArg1: EncodeLike<K1>,
KArg2: EncodeLike<K2>,
pub fn swap<XKArg1, XKArg2, YKArg1, YKArg2>(
x_k1: XKArg1,
x_k2: XKArg2,
y_k1: YKArg1,
y_k2: YKArg2
) where
XKArg1: EncodeLike<K1>,
XKArg2: EncodeLike<K2>,
YKArg1: EncodeLike<K1>,
YKArg2: EncodeLike<K2>,
[src]
x_k1: XKArg1,
x_k2: XKArg2,
y_k1: YKArg1,
y_k2: YKArg2
) where
XKArg1: EncodeLike<K1>,
XKArg2: EncodeLike<K2>,
YKArg1: EncodeLike<K1>,
YKArg2: EncodeLike<K2>,
pub fn insert<KArg1, KArg2, VArg>(k1: KArg1, k2: KArg2, val: VArg) where
KArg1: EncodeLike<K1>,
KArg2: EncodeLike<K2>,
VArg: EncodeLike<V>,
[src]
KArg1: EncodeLike<K1>,
KArg2: EncodeLike<K2>,
VArg: EncodeLike<V>,
pub fn remove<KArg1, KArg2>(k1: KArg1, k2: KArg2) where
KArg1: EncodeLike<K1>,
KArg2: EncodeLike<K2>,
[src]
KArg1: EncodeLike<K1>,
KArg2: EncodeLike<K2>,
pub fn remove_prefix<KArg1>(k1: KArg1) where
KArg1: EncodeLike<K1>,
[src]
KArg1: EncodeLike<K1>,
pub fn iter_prefix_values<KArg1>(k1: KArg1) -> PrefixIterator<V> where
KArg1: EncodeLike<K1> + ?Sized,
[src]
KArg1: EncodeLike<K1> + ?Sized,
pub fn mutate<KArg1, KArg2, R, F>(k1: KArg1, k2: KArg2, f: F) -> R where
KArg1: EncodeLike<K1>,
KArg2: EncodeLike<K2>,
F: FnOnce(&mut <G as StorageDoubleMap<K1, K2, V>>::Query) -> R,
[src]
KArg1: EncodeLike<K1>,
KArg2: EncodeLike<K2>,
F: FnOnce(&mut <G as StorageDoubleMap<K1, K2, V>>::Query) -> R,
pub fn mutate_exists<KArg1, KArg2, R, F>(k1: KArg1, k2: KArg2, f: F) -> R where
KArg1: EncodeLike<K1>,
KArg2: EncodeLike<K2>,
F: FnOnce(&mut Option<V>) -> R,
[src]
KArg1: EncodeLike<K1>,
KArg2: EncodeLike<K2>,
F: FnOnce(&mut Option<V>) -> R,
pub fn try_mutate<KArg1, KArg2, R, E, F>(
k1: KArg1,
k2: KArg2,
f: F
) -> Result<R, E> where
KArg1: EncodeLike<K1>,
KArg2: EncodeLike<K2>,
F: FnOnce(&mut <G as StorageDoubleMap<K1, K2, V>>::Query) -> Result<R, E>,
[src]
k1: KArg1,
k2: KArg2,
f: F
) -> Result<R, E> where
KArg1: EncodeLike<K1>,
KArg2: EncodeLike<K2>,
F: FnOnce(&mut <G as StorageDoubleMap<K1, K2, V>>::Query) -> Result<R, E>,
pub fn try_mutate_exists<KArg1, KArg2, R, E, F>(
k1: KArg1,
k2: KArg2,
f: F
) -> Result<R, E> where
KArg1: EncodeLike<K1>,
KArg2: EncodeLike<K2>,
F: FnOnce(&mut Option<V>) -> Result<R, E>,
[src]
k1: KArg1,
k2: KArg2,
f: F
) -> Result<R, E> where
KArg1: EncodeLike<K1>,
KArg2: EncodeLike<K2>,
F: FnOnce(&mut Option<V>) -> Result<R, E>,
pub fn append<Item, EncodeLikeItem, KArg1, KArg2>(
k1: KArg1,
k2: KArg2,
item: EncodeLikeItem
) where
KArg1: EncodeLike<K1>,
KArg2: EncodeLike<K2>,
Item: Encode,
V: StorageAppend<Item>,
EncodeLikeItem: EncodeLike<Item>,
[src]
k1: KArg1,
k2: KArg2,
item: EncodeLikeItem
) where
KArg1: EncodeLike<K1>,
KArg2: EncodeLike<K2>,
Item: Encode,
V: StorageAppend<Item>,
EncodeLikeItem: EncodeLike<Item>,
pub fn migrate_keys<OldHasher1, OldHasher2, KeyArg1, KeyArg2>(
key1: KeyArg1,
key2: KeyArg2
) -> Option<V> where
KeyArg1: EncodeLike<K1>,
KeyArg2: EncodeLike<K2>,
OldHasher1: StorageHasher,
OldHasher2: StorageHasher,
[src]
key1: KeyArg1,
key2: KeyArg2
) -> Option<V> where
KeyArg1: EncodeLike<K1>,
KeyArg2: EncodeLike<K2>,
OldHasher1: StorageHasher,
OldHasher2: StorageHasher,
pub fn decode_len<KArg1, KArg2>(key1: KArg1, key2: KArg2) -> Option<usize> where
KArg1: EncodeLike<K1>,
KArg2: EncodeLike<K2>,
V: StorageDecodeLength,
[src]
KArg1: EncodeLike<K1>,
KArg2: EncodeLike<K2>,
V: StorageDecodeLength,
impl<S, T> UncheckedInto<T> for S where
T: UncheckedFrom<S>,
[src]
impl<S, T> UncheckedInto<T> for S where
T: UncheckedFrom<S>,
[src]pub fn unchecked_into(self) -> T
[src]
impl<T, S> UniqueSaturatedInto<T> for S where
T: Bounded,
S: TryInto<T>,
[src]
impl<T, S> UniqueSaturatedInto<T> for S where
T: Bounded,
S: TryInto<T>,
[src]pub fn unique_saturated_into(self) -> T
[src]
impl<T> MaybeRefUnwindSafe for T where
T: RefUnwindSafe,
[src]
T: RefUnwindSafe,