Struct orml_tokens::Combiner
source · pub struct Combiner<AccountId, TestKey, A, B>(_);
Trait Implementations§
source§impl<AccountId, TestKey, A, B> Inspect<AccountId> for Combiner<AccountId, TestKey, A, B>where
TestKey: Contains<<B as Inspect<AccountId>>::AssetId>,
A: Inspect<AccountId, Balance = <B as Inspect<AccountId>>::Balance>,
B: Inspect<AccountId>,
impl<AccountId, TestKey, A, B> Inspect<AccountId> for Combiner<AccountId, TestKey, A, B>where TestKey: Contains<<B as Inspect<AccountId>>::AssetId>, A: Inspect<AccountId, Balance = <B as Inspect<AccountId>>::Balance>, B: Inspect<AccountId>,
§type AssetId = <B as Inspect<AccountId>>::AssetId
type AssetId = <B as Inspect<AccountId>>::AssetId
Means of identifying one asset class from another.
§type Balance = <B as Inspect<AccountId>>::Balance
type Balance = <B as Inspect<AccountId>>::Balance
Scalar type for representing balance of an account.
source§fn total_issuance(asset: Self::AssetId) -> Self::Balance
fn total_issuance(asset: Self::AssetId) -> Self::Balance
The total amount of issuance in the system.
source§fn minimum_balance(asset: Self::AssetId) -> Self::Balance
fn minimum_balance(asset: Self::AssetId) -> Self::Balance
The minimum balance any single account may have.
source§fn balance(asset: Self::AssetId, who: &AccountId) -> Self::Balance
fn balance(asset: Self::AssetId, who: &AccountId) -> Self::Balance
Get the balance of
who
which does not include funds which are exclusively allocated to
subsystems of the chain (“on hold” or “reserved”). Read moresource§fn total_balance(asset: Self::AssetId, who: &AccountId) -> Self::Balance
fn total_balance(asset: Self::AssetId, who: &AccountId) -> Self::Balance
Get the total amount of funds whose ultimate beneficial ownership can be determined as
who
. Read moresource§fn reducible_balance(
asset: Self::AssetId,
who: &AccountId,
preservation: Preservation,
fortitude: Fortitude
) -> Self::Balance
fn reducible_balance( asset: Self::AssetId, who: &AccountId, preservation: Preservation, fortitude: Fortitude ) -> Self::Balance
Get the maximum amount that
who
can withdraw/transfer successfully based on whether the
account should be kept alive (preservation
) or whether we are willing to force the
transfer and potentially go below user-level restrictions on the minimum amount of the
account. Read moresource§fn can_deposit(
asset: Self::AssetId,
who: &AccountId,
amount: Self::Balance,
provenance: Provenance
) -> DepositConsequence
fn can_deposit( asset: Self::AssetId, who: &AccountId, amount: Self::Balance, provenance: Provenance ) -> DepositConsequence
source§fn can_withdraw(
asset: Self::AssetId,
who: &AccountId,
amount: Self::Balance
) -> WithdrawConsequence<Self::Balance>
fn can_withdraw( asset: Self::AssetId, who: &AccountId, amount: Self::Balance ) -> WithdrawConsequence<Self::Balance>
Returns
Failed
if the asset
balance of who
may not be decreased by amount
, otherwise
the consequence.source§fn asset_exists(asset: Self::AssetId) -> bool
fn asset_exists(asset: Self::AssetId) -> bool
Returns
true
if an asset
exists.source§fn active_issuance(asset: Self::AssetId) -> Self::Balance
fn active_issuance(asset: Self::AssetId) -> Self::Balance
The total amount of issuance in the system excluding those which are controlled by the
system.
source§impl<AccountId, TestKey, A, B> Mutate<AccountId> for Combiner<AccountId, TestKey, A, B>where
TestKey: Contains<<B as Inspect<AccountId>>::AssetId>,
A: Mutate<AccountId, Balance = <B as Inspect<AccountId>>::Balance>,
B: Mutate<AccountId>,
impl<AccountId, TestKey, A, B> Mutate<AccountId> for Combiner<AccountId, TestKey, A, B>where TestKey: Contains<<B as Inspect<AccountId>>::AssetId>, A: Mutate<AccountId, Balance = <B as Inspect<AccountId>>::Balance>, B: Mutate<AccountId>,
source§fn mint_into(
asset: Self::AssetId,
dest: &AccountId,
amount: Self::Balance
) -> Result<Self::Balance, DispatchError>
fn mint_into( asset: Self::AssetId, dest: &AccountId, amount: Self::Balance ) -> Result<Self::Balance, DispatchError>
Increase the balance of
who
by exactly amount
, minting new tokens. If that isn’t
possible then an Err
is returned and nothing is changed.source§fn burn_from(
asset: Self::AssetId,
dest: &AccountId,
amount: Self::Balance,
precision: Precision,
fortitude: Fortitude
) -> Result<Self::Balance, DispatchError>
fn burn_from( asset: Self::AssetId, dest: &AccountId, amount: Self::Balance, precision: Precision, fortitude: Fortitude ) -> Result<Self::Balance, DispatchError>
Decrease the balance of
who
by at least amount
, possibly slightly more in the case of
minimum-balance requirements, burning the tokens. If that isn’t possible then an Err
is
returned and nothing is changed. If successful, the amount of tokens reduced is returned.source§fn transfer(
asset: Self::AssetId,
source: &AccountId,
dest: &AccountId,
amount: Self::Balance,
preservation: Preservation
) -> Result<Self::Balance, DispatchError>
fn transfer( asset: Self::AssetId, source: &AccountId, dest: &AccountId, amount: Self::Balance, preservation: Preservation ) -> Result<Self::Balance, DispatchError>
Transfer funds from one account into another.
source§fn shelve(
asset: Self::AssetId,
who: &AccountId,
amount: Self::Balance
) -> Result<Self::Balance, DispatchError>
fn shelve( asset: Self::AssetId, who: &AccountId, amount: Self::Balance ) -> Result<Self::Balance, DispatchError>
source§fn restore(
asset: Self::AssetId,
who: &AccountId,
amount: Self::Balance
) -> Result<Self::Balance, DispatchError>
fn restore( asset: Self::AssetId, who: &AccountId, amount: Self::Balance ) -> Result<Self::Balance, DispatchError>
source§fn set_balance(
asset: Self::AssetId,
who: &AccountId,
amount: Self::Balance
) -> Self::Balance
fn set_balance( asset: Self::AssetId, who: &AccountId, amount: Self::Balance ) -> Self::Balance
Simple infallible function to force an account to have a particular balance, good for use
in tests and benchmarks but not recommended for production code owing to the lack of
error reporting. Read more
fn done_mint_into( _asset: Self::AssetId, _who: &AccountId, _amount: Self::Balance )
fn done_burn_from( _asset: Self::AssetId, _who: &AccountId, _amount: Self::Balance )
fn done_shelve(_asset: Self::AssetId, _who: &AccountId, _amount: Self::Balance)
fn done_restore(_asset: Self::AssetId, _who: &AccountId, _amount: Self::Balance)
fn done_transfer( _asset: Self::AssetId, _source: &AccountId, _dest: &AccountId, _amount: Self::Balance )
source§impl<AccountId, TestKey, A, B> Unbalanced<AccountId> for Combiner<AccountId, TestKey, A, B>where
TestKey: Contains<<B as Inspect<AccountId>>::AssetId>,
A: Mutate<AccountId, Balance = <B as Inspect<AccountId>>::Balance>,
B: Mutate<AccountId>,
impl<AccountId, TestKey, A, B> Unbalanced<AccountId> for Combiner<AccountId, TestKey, A, B>where TestKey: Contains<<B as Inspect<AccountId>>::AssetId>, A: Mutate<AccountId, Balance = <B as Inspect<AccountId>>::Balance>, B: Mutate<AccountId>,
source§fn handle_dust(_dust: Dust<AccountId, Self>)
fn handle_dust(_dust: Dust<AccountId, Self>)
Do something with the dust which has been destroyed from the system.
Dust
can be converted
into a Credit
with the Balanced
trait impl.source§fn write_balance(
asset: Self::AssetId,
who: &AccountId,
amount: Self::Balance
) -> Result<Option<Self::Balance>, DispatchError>
fn write_balance( asset: Self::AssetId, who: &AccountId, amount: Self::Balance ) -> Result<Option<Self::Balance>, DispatchError>
source§fn set_total_issuance(asset: Self::AssetId, amount: Self::Balance)
fn set_total_issuance(asset: Self::AssetId, amount: Self::Balance)
Set the total issuance to
amount
.source§fn handle_raw_dust(asset: Self::AssetId, amount: Self::Balance)
fn handle_raw_dust(asset: Self::AssetId, amount: Self::Balance)
Create some dust and handle it with
Self::handle_dust
. This is an unbalanced operation
and it must only be used when an account is modified in a raw fashion, outside of the entire
fungibles API. The amount
is capped at Self::minimum_balance() - 1
. Read moresource§fn decrease_balance(
asset: Self::AssetId,
who: &AccountId,
amount: Self::Balance,
precision: Precision,
preservation: Preservation,
force: Fortitude
) -> Result<Self::Balance, DispatchError>
fn decrease_balance( asset: Self::AssetId, who: &AccountId, amount: Self::Balance, precision: Precision, preservation: Preservation, force: Fortitude ) -> Result<Self::Balance, DispatchError>
source§fn increase_balance(
asset: Self::AssetId,
who: &AccountId,
amount: Self::Balance,
precision: Precision
) -> Result<Self::Balance, DispatchError>
fn increase_balance( asset: Self::AssetId, who: &AccountId, amount: Self::Balance, precision: Precision ) -> Result<Self::Balance, DispatchError>
source§fn deactivate(_asset: Self::AssetId, _: Self::Balance)
fn deactivate(_asset: Self::AssetId, _: Self::Balance)
Reduce the active issuance by some amount.
source§fn reactivate(_asset: Self::AssetId, _: Self::Balance)
fn reactivate(_asset: Self::AssetId, _: Self::Balance)
Increase the active issuance by some amount, up to the outstanding amount reduced.
Auto Trait Implementations§
impl<AccountId, TestKey, A, B> RefUnwindSafe for Combiner<AccountId, TestKey, A, B>where A: RefUnwindSafe, AccountId: RefUnwindSafe, B: RefUnwindSafe, TestKey: RefUnwindSafe,
impl<AccountId, TestKey, A, B> Send for Combiner<AccountId, TestKey, A, B>where A: Send, AccountId: Send, B: Send, TestKey: Send,
impl<AccountId, TestKey, A, B> Sync for Combiner<AccountId, TestKey, A, B>where A: Sync, AccountId: Sync, B: Sync, TestKey: Sync,
impl<AccountId, TestKey, A, B> Unpin for Combiner<AccountId, TestKey, A, B>where A: Unpin, AccountId: Unpin, B: Unpin, TestKey: Unpin,
impl<AccountId, TestKey, A, B> UnwindSafe for Combiner<AccountId, TestKey, A, B>where A: UnwindSafe, AccountId: UnwindSafe, B: UnwindSafe, TestKey: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CheckedConversion for T
impl<T> CheckedConversion for T
source§impl<T> FmtForward for T
impl<T> FmtForward for T
source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where Self: Binary,
Causes
self
to use its Binary
implementation when Debug
-formatted.source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where Self: Display,
Causes
self
to use its Display
implementation when
Debug
-formatted.source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where Self: LowerExp,
Causes
self
to use its LowerExp
implementation when
Debug
-formatted.source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where Self: LowerHex,
Causes
self
to use its LowerHex
implementation when
Debug
-formatted.source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where Self: Octal,
Causes
self
to use its Octal
implementation when Debug
-formatted.source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where Self: Pointer,
Causes
self
to use its Pointer
implementation when
Debug
-formatted.source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where Self: UpperExp,
Causes
self
to use its UpperExp
implementation when
Debug
-formatted.source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where Self: UpperHex,
Causes
self
to use its UpperHex
implementation when
Debug
-formatted.source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T, Outer> IsWrappedBy<Outer> for Twhere
Outer: AsRef<T> + AsMut<T> + From<T>,
T: From<Outer>,
impl<T, Outer> IsWrappedBy<Outer> for Twhere Outer: AsRef<T> + AsMut<T> + From<T>, T: From<Outer>,
source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere T: ?Sized,
source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere Self: Sized,
Pipes by value. This is generally the method you want to use. Read more
source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere R: 'a,
Borrows
self
and passes that borrow into the pipe function. Read moresource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere R: 'a,
Mutably borrows
self
and passes that borrow into the pipe function. Read moresource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> Rwhere
Self: Borrow<B>,
B: 'a + ?Sized,
R: 'a,
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> Rwhere Self: Borrow<B>, B: 'a + ?Sized, R: 'a,
source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R
) -> Rwhere
Self: BorrowMut<B>,
B: 'a + ?Sized,
R: 'a,
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R ) -> Rwhere Self: BorrowMut<B>, B: 'a + ?Sized, R: 'a,
source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> Rwhere
Self: AsRef<U>,
U: 'a + ?Sized,
R: 'a,
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> Rwhere Self: AsRef<U>, U: 'a + ?Sized, R: 'a,
Borrows
self
, then passes self.as_ref()
into the pipe function.source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> Rwhere
Self: AsMut<U>,
U: 'a + ?Sized,
R: 'a,
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> Rwhere Self: AsMut<U>, U: 'a + ?Sized, R: 'a,
Mutably borrows
self
, then passes self.as_mut()
into the pipe
function.source§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<T> SaturatedConversion for T
impl<T> SaturatedConversion for T
source§fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Selfwhere Self: UniqueSaturatedFrom<T>,
source§fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> Twhere Self: UniqueSaturatedInto<T>,
Consume self to return an equivalent value of
T
. Read moresource§impl<T> Tap for T
impl<T> Tap for T
source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Selfwhere
Self: Borrow<B>,
B: ?Sized,
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Selfwhere Self: Borrow<B>, B: ?Sized,
Immutable access to the
Borrow<B>
of a value. Read moresource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere
Self: BorrowMut<B>,
B: ?Sized,
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere Self: BorrowMut<B>, B: ?Sized,
Mutable access to the
BorrowMut<B>
of a value. Read moresource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Selfwhere
Self: AsRef<R>,
R: ?Sized,
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Selfwhere Self: AsRef<R>, R: ?Sized,
Immutable access to the
AsRef<R>
view of a value. Read moresource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere
Self: AsMut<R>,
R: ?Sized,
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere Self: AsMut<R>, R: ?Sized,
Mutable access to the
AsMut<R>
view of a value. Read moresource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Selfwhere
Self: Deref<Target = T>,
T: ?Sized,
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Selfwhere Self: Deref<Target = T>, T: ?Sized,
Immutable access to the
Deref::Target
of a value. Read moresource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Selfwhere
Self: DerefMut<Target = T> + Deref,
T: ?Sized,
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Selfwhere Self: DerefMut<Target = T> + Deref, T: ?Sized,
Mutable access to the
Deref::Target
of a value. Read moresource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
Calls
.tap()
only in debug builds, and is erased in release builds.source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
Calls
.tap_mut()
only in debug builds, and is erased in release
builds.source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Selfwhere
Self: Borrow<B>,
B: ?Sized,
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Selfwhere Self: Borrow<B>, B: ?Sized,
Calls
.tap_borrow()
only in debug builds, and is erased in release
builds.source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere
Self: BorrowMut<B>,
B: ?Sized,
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere Self: BorrowMut<B>, B: ?Sized,
Calls
.tap_borrow_mut()
only in debug builds, and is erased in release
builds.source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Selfwhere
Self: AsRef<R>,
R: ?Sized,
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Selfwhere Self: AsRef<R>, R: ?Sized,
Calls
.tap_ref()
only in debug builds, and is erased in release
builds.source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere
Self: AsMut<R>,
R: ?Sized,
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere Self: AsMut<R>, R: ?Sized,
Calls
.tap_ref_mut()
only in debug builds, and is erased in release
builds.source§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere T: UncheckedFrom<S>,
source§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
The counterpart to
unchecked_from
.source§impl<T, S> UniqueSaturatedInto<T> for Swhere
T: Bounded,
S: TryInto<T>,
impl<T, S> UniqueSaturatedInto<T> for Swhere T: Bounded, S: TryInto<T>,
source§fn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
Consume self to return an equivalent value of
T
.