Struct orml_tokens::module::Pallet [−][src]
pub struct Pallet<T>(_);
Expand description
The pallet implementing the on-chain logic.
Implementations
pub fn transfer(
origin: OriginFor<T>,
dest: <T::Lookup as StaticLookup>::Source,
currency_id: T::CurrencyId,
amount: T::Balance
) -> DispatchResult
pub fn transfer(
origin: OriginFor<T>,
dest: <T::Lookup as StaticLookup>::Source,
currency_id: T::CurrencyId,
amount: T::Balance
) -> DispatchResult
Transfer some liquid free balance to another account.
transfer
will set the FreeBalance
of the sender and receiver.
It will decrease the total issuance of the system by the
TransferFee
. If the sender’s account is below the existential
deposit as a result of the transfer, the account will be reaped.
The dispatch origin for this call must be Signed
by the
transactor.
dest
: The recipient of the transfer.currency_id
: currency type.amount
: free balance amount to tranfer.
pub fn transfer_all(
origin: OriginFor<T>,
dest: <T::Lookup as StaticLookup>::Source,
currency_id: T::CurrencyId,
keep_alive: bool
) -> DispatchResult
pub fn transfer_all(
origin: OriginFor<T>,
dest: <T::Lookup as StaticLookup>::Source,
currency_id: T::CurrencyId,
keep_alive: bool
) -> DispatchResult
Transfer all remaining balance to the given account.
NOTE: This function only attempts to transfer transferable
balances. This means that any locked, reserved, or existential
deposits (when keep_alive
is true
), will not be transferred by
this function. To ensure that this function results in a killed
account, you might need to prepare the account by removing any
reference counters, storage deposits, etc…
The dispatch origin for this call must be Signed
by the
transactor.
dest
: The recipient of the transfer.currency_id
: currency type.keep_alive
: A boolean to determine if thetransfer_all
operation should send all of the funds the account has, causing the sender account to be killed (false), or transfer everything except at least the existential deposit, which will guarantee to keep the sender account alive (true).
pub fn transfer_keep_alive(
origin: OriginFor<T>,
dest: <T::Lookup as StaticLookup>::Source,
currency_id: T::CurrencyId,
amount: T::Balance
) -> DispatchResultWithPostInfo
pub fn transfer_keep_alive(
origin: OriginFor<T>,
dest: <T::Lookup as StaticLookup>::Source,
currency_id: T::CurrencyId,
amount: T::Balance
) -> DispatchResultWithPostInfo
Same as the [transfer
] call, but with a check that the transfer
will not kill the origin account.
99% of the time you want [transfer
] instead.
The dispatch origin for this call must be Signed
by the
transactor.
dest
: The recipient of the transfer.currency_id
: currency type.amount
: free balance amount to tranfer.
pub fn force_transfer(
origin: OriginFor<T>,
source: <T::Lookup as StaticLookup>::Source,
dest: <T::Lookup as StaticLookup>::Source,
currency_id: T::CurrencyId,
amount: T::Balance
) -> DispatchResult
pub fn force_transfer(
origin: OriginFor<T>,
source: <T::Lookup as StaticLookup>::Source,
dest: <T::Lookup as StaticLookup>::Source,
currency_id: T::CurrencyId,
amount: T::Balance
) -> DispatchResult
Exactly as transfer
, except the origin must be root and the source
account may be specified.
The dispatch origin for this call must be Root.
source
: The sender of the transfer.dest
: The recipient of the transfer.currency_id
: currency type.amount
: free balance amount to tranfer.
pub fn set_balance(
origin: OriginFor<T>,
who: <T::Lookup as StaticLookup>::Source,
currency_id: T::CurrencyId,
new_free: T::Balance,
new_reserved: T::Balance
) -> DispatchResult
pub fn set_balance(
origin: OriginFor<T>,
who: <T::Lookup as StaticLookup>::Source,
currency_id: T::CurrencyId,
new_free: T::Balance,
new_reserved: T::Balance
) -> DispatchResult
Set the balances of a given account.
This will alter FreeBalance
and ReservedBalance
in storage. it
will also decrease the total issuance of the system
(TotalIssuance
). If the new free or reserved balance is below the
existential deposit, it will reap the AccountInfo
.
The dispatch origin for this call is root
.
The total issuance of a token type.
pub fn locks<KArg1, KArg2>(
k1: KArg1,
k2: KArg2
) -> BoundedVec<BalanceLock<T::Balance>, T::MaxLocks> where
KArg1: EncodeLike<T::AccountId>,
KArg2: EncodeLike<T::CurrencyId>,
pub fn locks<KArg1, KArg2>(
k1: KArg1,
k2: KArg2
) -> BoundedVec<BalanceLock<T::Balance>, T::MaxLocks> where
KArg1: EncodeLike<T::AccountId>,
KArg2: EncodeLike<T::CurrencyId>,
Any liquidity locks of a token type under an account. NOTE: Should only be accessed when setting, changing and freeing a lock.
pub fn accounts<KArg1, KArg2>(k1: KArg1, k2: KArg2) -> AccountData<T::Balance> where
KArg1: EncodeLike<T::AccountId>,
KArg2: EncodeLike<T::CurrencyId>,
pub fn accounts<KArg1, KArg2>(k1: KArg1, k2: KArg2) -> AccountData<T::Balance> where
KArg1: EncodeLike<T::AccountId>,
KArg2: EncodeLike<T::CurrencyId>,
The balance of a token type under an account.
NOTE: If the total is ever zero, decrease account ref account.
NOTE: This is only used in the case that this module is used to store balances.
Trait Implementations
Returns the current storage version as supported by the pallet.
Returns the on-chain storage version of the pallet as stored in the storage.
The block is being finalized. Implement to have something happen.
This will be run when the block is being finalized (before on_finalize
).
Implement to have something happen using the remaining weight.
Will not fire if the remaining weight is 0.
Return the weight used, the hook will subtract it from current weight used
and pass the result to the next on_idle
hook if it exists. Read more
The block is being initialized. Implement to have something happen. Read more
Perform a module upgrade. Read more
Implementing this function on a module allows you to perform long-running tasks that make (by default) validators generate transactions that feed results of those long-running computations back on chain. Read more
Run integrity test. Read more
type AssetId = T::CurrencyId
type AssetId = T::CurrencyId
Means of identifying one asset class from another.
The total amount of issuance in the system.
The minimum balance any single account may have.
Get the asset
balance of who
.
Get the maximum amount of asset
that who
can withdraw/transfer successfully.
fn can_deposit(
asset_id: Self::AssetId,
who: &T::AccountId,
amount: Self::Balance
) -> DepositConsequence
fn can_deposit(
asset_id: Self::AssetId,
who: &T::AccountId,
amount: Self::Balance
) -> DepositConsequence
Returns true
if the asset
balance of who
may be increased by amount
.
fn can_withdraw(
asset_id: Self::AssetId,
who: &T::AccountId,
amount: Self::Balance
) -> WithdrawConsequence<Self::Balance>
fn can_withdraw(
asset_id: Self::AssetId,
who: &T::AccountId,
amount: Self::Balance
) -> WithdrawConsequence<Self::Balance>
Returns Failed
if the asset
balance of who
may not be decreased by amount
, otherwise
the consequence. Read more
Run integrity test. Read more
Is a no-op if value
to be slashed is zero.
NOTE: slash()
prefers free balance, but assumes that reserve
balance can be drawn from in extreme circumstances. can_slash()
should be used prior to slash()
to avoid having to draw from
reserved funds, however we err on the side of punishment if things
are inconsistent or can_slash
wasn’t used appropriately.
type CurrencyId = T::CurrencyId
type CurrencyId = T::CurrencyId
The currency identifier.
Existential deposit of currency_id
.
The total amount of issuance of currency_id
.
fn ensure_can_withdraw(
currency_id: Self::CurrencyId,
who: &T::AccountId,
amount: Self::Balance
) -> DispatchResult
fn ensure_can_withdraw(
currency_id: Self::CurrencyId,
who: &T::AccountId,
amount: Self::Balance
) -> DispatchResult
A dry-run of withdraw
. Returns Ok
iff the account is able to make a
withdrawal of the given amount. Read more
fn transfer(
currency_id: Self::CurrencyId,
from: &T::AccountId,
to: &T::AccountId,
amount: Self::Balance
) -> DispatchResult
fn transfer(
currency_id: Self::CurrencyId,
from: &T::AccountId,
to: &T::AccountId,
amount: Self::Balance
) -> DispatchResult
Transfer some amount from one account to another.
fn deposit(
currency_id: Self::CurrencyId,
who: &T::AccountId,
amount: Self::Balance
) -> DispatchResult
fn deposit(
currency_id: Self::CurrencyId,
who: &T::AccountId,
amount: Self::Balance
) -> DispatchResult
Add amount
to the balance of who
under currency_id
and increase
total issuance. Read more
fn withdraw(
currency_id: Self::CurrencyId,
who: &T::AccountId,
amount: Self::Balance
) -> DispatchResult
fn withdraw(
currency_id: Self::CurrencyId,
who: &T::AccountId,
amount: Self::Balance
) -> DispatchResult
Remove amount
from the balance of who
under currency_id
and reduce
total issuance. Read more
fn update_balance(
currency_id: Self::CurrencyId,
who: &T::AccountId,
by_amount: Self::Amount
) -> DispatchResult
fn update_balance(
currency_id: Self::CurrencyId,
who: &T::AccountId,
by_amount: Self::Amount
) -> DispatchResult
Add or remove abs(by_amount
) from the balance of who
under
currency_id
. If positive by_amount
, do add, else do remove. Read more
type Moment = T::BlockNumber
type Moment = T::BlockNumber
The quantity used to denote time; usually just a BlockNumber
.
fn set_lock(
lock_id: LockIdentifier,
currency_id: Self::CurrencyId,
who: &T::AccountId,
amount: Self::Balance
) -> DispatchResult
fn set_lock(
lock_id: LockIdentifier,
currency_id: Self::CurrencyId,
who: &T::AccountId,
amount: Self::Balance
) -> DispatchResult
Create a new balance lock on account who
. Read more
fn extend_lock(
lock_id: LockIdentifier,
currency_id: Self::CurrencyId,
who: &T::AccountId,
amount: Self::Balance
) -> DispatchResult
fn extend_lock(
lock_id: LockIdentifier,
currency_id: Self::CurrencyId,
who: &T::AccountId,
amount: Self::Balance
) -> DispatchResult
Changes a balance lock (selected by lock_id
) so that it becomes less
liquid in all parameters or creates a new one if it does not exist. Read more
fn remove_lock(
lock_id: LockIdentifier,
currency_id: Self::CurrencyId,
who: &T::AccountId
) -> DispatchResult
fn remove_lock(
lock_id: LockIdentifier,
currency_id: Self::CurrencyId,
who: &T::AccountId
) -> DispatchResult
Remove an existing lock.
fn can_reserve(
currency_id: Self::CurrencyId,
who: &T::AccountId,
value: Self::Balance
) -> bool
fn can_reserve(
currency_id: Self::CurrencyId,
who: &T::AccountId,
value: Self::Balance
) -> bool
Check if who
can reserve value
from their free balance.
Always true
if value to be reserved is zero.
fn slash_reserved(
currency_id: Self::CurrencyId,
who: &T::AccountId,
value: Self::Balance
) -> Self::Balance
fn slash_reserved(
currency_id: Self::CurrencyId,
who: &T::AccountId,
value: Self::Balance
) -> Self::Balance
Slash from reserved balance, returning any amount that was unable to be slashed.
Is a no-op if the value to be slashed is zero.
fn reserve(
currency_id: Self::CurrencyId,
who: &T::AccountId,
value: Self::Balance
) -> DispatchResult
fn reserve(
currency_id: Self::CurrencyId,
who: &T::AccountId,
value: Self::Balance
) -> DispatchResult
Move value
from the free balance from who
to their reserved
balance.
Is a no-op if value to be reserved is zero.
Unreserve some funds, returning any amount that was unable to be unreserved.
Is a no-op if the value to be unreserved is zero.
fn repatriate_reserved(
currency_id: Self::CurrencyId,
slashed: &T::AccountId,
beneficiary: &T::AccountId,
value: Self::Balance,
status: BalanceStatus
) -> Result<Self::Balance, DispatchError>
fn repatriate_reserved(
currency_id: Self::CurrencyId,
slashed: &T::AccountId,
beneficiary: &T::AccountId,
value: Self::Balance,
status: BalanceStatus
) -> Result<Self::Balance, DispatchError>
Move the reserved balance of one account into the balance of
another, according to status
.
Is a no-op if:
- the value to be moved is zero; or
- the
slashed
id equal tobeneficiary
and thestatus
isReserved
.
The amount of the balance of a given account that is externally reserved; this can still get slashed, but gets slashed last of all. Read more
Attempt to increase the asset
balance of who
by amount
. Read more
Attempt to reduce the asset
balance of who
by amount
. Read more
Attempt to reduce the asset
balance of who
by as much as possible up to amount
, and
possibly slightly more due to minimum_balance requirements. If no decrease is possible then
an Err
is returned and nothing is changed. If successful, the amount of tokens reduced is
returned. Read more
Hold some funds in an account.
Release some funds in an account from being on hold. Read more
This function is being called after every block import (when fully synced). Read more
The block is being finalized. Implement to have something happen. Read more
Something that should happen at genesis.
The block is being finalized.
Implement to have something happen in case there is leftover weight.
Check the passed remaining_weight
to make sure it is high enough to allow for
your pallet’s extra computation. Read more
The block is being initialized. Implement to have something happen. Read more
Perform a module upgrade. Read more
Name of the Rust module containing the pallet.
Version of the crate containing the pallet.
Extend the given vector by all of the pallets’ information that this type represents. Read more
All of the pallets’ information that this type represents.
fn set_balance(
asset_id: Self::AssetId,
who: &T::AccountId,
amount: Self::Balance
) -> DispatchResult
fn set_balance(
asset_id: Self::AssetId,
who: &T::AccountId,
amount: Self::Balance
) -> DispatchResult
Set the asset
balance of who
to amount
. If this cannot be done for some reason (e.g.
because the account cannot be created or an overflow) then an Err
is returned. Read more
Set the total issuance of asset
to amount
.
fn decrease_balance(
asset: Self::AssetId,
who: &AccountId,
amount: Self::Balance
) -> Result<Self::Balance, DispatchError>
fn decrease_balance(
asset: Self::AssetId,
who: &AccountId,
amount: Self::Balance
) -> Result<Self::Balance, DispatchError>
Reduce the asset
balance of who
by amount
. If it cannot be reduced by that amount for
some reason, return Err
and don’t reduce it at all. If Ok, return the imbalance. Read more
Reduce the asset
balance of who
by the most that is possible, up to amount
. Read more
fn increase_balance(
asset: Self::AssetId,
who: &AccountId,
amount: Self::Balance
) -> Result<Self::Balance, DispatchError>
fn increase_balance(
asset: Self::AssetId,
who: &AccountId,
amount: Self::Balance
) -> Result<Self::Balance, DispatchError>
Increase the asset
balance of who
by amount
. If it cannot be increased by that amount
for some reason, return Err
and don’t increase it at all. If Ok, return the imbalance. Read more
Auto Trait Implementations
impl<T> RefUnwindSafe for Pallet<T> where
T: RefUnwindSafe,
impl<T> UnwindSafe for Pallet<T> where
T: UnwindSafe,
Blanket Implementations
type OnDropCredit = DecreaseIssuance<AccountId, U>
type OnDropCredit = DecreaseIssuance<AccountId, U>
The type for managing what happens when an instance of Credit
is dropped without being
used. Read more
type OnDropDebt = IncreaseIssuance<AccountId, U>
type OnDropDebt = IncreaseIssuance<AccountId, U>
The type for managing what happens when an instance of Debt
is dropped without being used.
Reduce the total issuance by amount
and return the according imbalance. The imbalance will
typically be used to reduce an account by the same amount with e.g. settle
. Read more
Increase the total issuance by amount
and return the according imbalance. The imbalance
will typically be used to increase an account by the same amount with e.g.
resolve_into_existing
or resolve_creating
. Read more
pub fn slash(
asset: <U as Inspect<AccountId>>::AssetId,
who: &AccountId,
amount: <U as Inspect<AccountId>>::Balance
) -> (Imbalance<<U as Inspect<AccountId>>::AssetId, <U as Inspect<AccountId>>::Balance, DecreaseIssuance<AccountId, U>, IncreaseIssuance<AccountId, U>>, <U as Inspect<AccountId>>::Balance)
pub fn slash(
asset: <U as Inspect<AccountId>>::AssetId,
who: &AccountId,
amount: <U as Inspect<AccountId>>::Balance
) -> (Imbalance<<U as Inspect<AccountId>>::AssetId, <U as Inspect<AccountId>>::Balance, DecreaseIssuance<AccountId, U>, IncreaseIssuance<AccountId, U>>, <U as Inspect<AccountId>>::Balance)
Deducts up to value
from the combined balance of who
, preferring to deduct from the
free balance. This function cannot fail. Read more
Mints exactly value
into the asset
account of who
. Read more
Removes value
free asset
balance from who
account if possible. Read more
fn pair(
asset: Self::AssetId,
amount: Self::Balance
) -> (Imbalance<Self::AssetId, Self::Balance, Self::OnDropDebt, Self::OnDropCredit>, Imbalance<Self::AssetId, Self::Balance, Self::OnDropCredit, Self::OnDropDebt>)
fn pair(
asset: Self::AssetId,
amount: Self::Balance
) -> (Imbalance<Self::AssetId, Self::Balance, Self::OnDropDebt, Self::OnDropCredit>, Imbalance<Self::AssetId, Self::Balance, Self::OnDropCredit, Self::OnDropDebt>)
Produce a pair of imbalances that cancel each other out exactly. Read more
fn resolve(
who: &AccountId,
credit: Imbalance<Self::AssetId, Self::Balance, Self::OnDropCredit, Self::OnDropDebt>
) -> Result<(), Imbalance<Self::AssetId, Self::Balance, Self::OnDropCredit, Self::OnDropDebt>>
fn resolve(
who: &AccountId,
credit: Imbalance<Self::AssetId, Self::Balance, Self::OnDropCredit, Self::OnDropDebt>
) -> Result<(), Imbalance<Self::AssetId, Self::Balance, Self::OnDropCredit, Self::OnDropDebt>>
The balance of who
is increased in order to counter credit
. If the whole of credit
cannot be countered, then nothing is changed and the original credit
is returned in an
Err
. Read more
fn settle(
who: &AccountId,
debt: Imbalance<Self::AssetId, Self::Balance, Self::OnDropDebt, Self::OnDropCredit>
) -> Result<Imbalance<Self::AssetId, Self::Balance, Self::OnDropCredit, Self::OnDropDebt>, Imbalance<Self::AssetId, Self::Balance, Self::OnDropDebt, Self::OnDropCredit>>
fn settle(
who: &AccountId,
debt: Imbalance<Self::AssetId, Self::Balance, Self::OnDropDebt, Self::OnDropCredit>
) -> Result<Imbalance<Self::AssetId, Self::Balance, Self::OnDropCredit, Self::OnDropDebt>, Imbalance<Self::AssetId, Self::Balance, Self::OnDropDebt, Self::OnDropCredit>>
The balance of who
is decreased in order to counter debt
. If the whole of debt
cannot be countered, then nothing is changed and the original debt
is returned in an
Err
. Read more
impl<AccountId, T> BalancedHold<AccountId> for T where
T: Balanced<AccountId> + MutateHold<AccountId>,
impl<AccountId, T> BalancedHold<AccountId> for T where
T: Balanced<AccountId> + MutateHold<AccountId>,
pub fn slash_held(
asset: <T as Inspect<AccountId>>::AssetId,
who: &AccountId,
amount: <T as Inspect<AccountId>>::Balance
) -> (Imbalance<<T as Inspect<AccountId>>::AssetId, <T as Inspect<AccountId>>::Balance, <T as Balanced<AccountId>>::OnDropCredit, <T as Balanced<AccountId>>::OnDropDebt>, <T as Inspect<AccountId>>::Balance)
pub fn slash_held(
asset: <T as Inspect<AccountId>>::AssetId,
who: &AccountId,
amount: <T as Inspect<AccountId>>::Balance
) -> (Imbalance<<T as Inspect<AccountId>>::AssetId, <T as Inspect<AccountId>>::Balance, <T as Balanced<AccountId>>::OnDropCredit, <T as Balanced<AccountId>>::OnDropDebt>, <T as Inspect<AccountId>>::Balance)
Release and slash some funds in an account. Read more
Mutably borrows from an owned value. Read more
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
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
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
Compare self to key
and return true
if they are equal.
Causes self
to use its Binary
implementation when Debug
-formatted.
Causes self
to use its Display
implementation when
Debug
-formatted. Read more
Causes self
to use its LowerExp
implementation when
Debug
-formatted. Read more
Causes self
to use its LowerHex
implementation when
Debug
-formatted. Read more
Causes self
to use its Octal
implementation when Debug
-formatted.
Causes self
to use its Pointer
implementation when
Debug
-formatted. Read more
Causes self
to use its UpperExp
implementation when
Debug
-formatted. Read more
Causes self
to use its UpperHex
implementation when
Debug
-formatted. Read more
impl<T> PalletVersionToStorageVersionHelper for T where
T: GetStorageVersion + PalletInfoAccess,
impl<T> PalletVersionToStorageVersionHelper for T where
T: GetStorageVersion + PalletInfoAccess,
Pipes by value. This is generally the method you want to use. Read more
Borrows self
and passes that borrow into the pipe function. Read more
Mutably borrows self
and passes that borrow into the pipe function. Read more
Borrows self
, then passes self.borrow()
into the pipe function. Read more
Mutably borrows self
, then passes self.borrow_mut()
into the pipe
function. Read more
Borrows self
, then passes self.as_ref()
into the pipe function.
Mutably borrows self
, then passes self.as_mut()
into the pipe
function. Read more
Borrows self
, then passes self.deref()
into the pipe function.
fn pipe_as_ref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
Self: AsRef<T>,
T: 'a,
R: 'a,
fn pipe_as_ref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
Self: AsRef<T>,
T: 'a,
R: 'a,
Pipes a trait borrow into a function that cannot normally be called in suffix position. Read more
fn pipe_borrow<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
Self: Borrow<T>,
T: 'a,
R: 'a,
fn pipe_borrow<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
Self: Borrow<T>,
T: 'a,
R: 'a,
Pipes a trait borrow into a function that cannot normally be called in suffix position. Read more
fn pipe_deref<'a, R>(&'a self, func: impl FnOnce(&'a Self::Target) -> R) -> R where
Self: Deref,
R: 'a,
fn pipe_deref<'a, R>(&'a self, func: impl FnOnce(&'a Self::Target) -> R) -> R where
Self: Deref,
R: 'a,
Pipes a dereference into a function that cannot normally be called in suffix position. Read more
Pipes a reference into a function that cannot ordinarily be called in suffix position. Read more
Immutable access to the Borrow<B>
of a value. Read more
Mutable access to the BorrowMut<B>
of a value. Read more
Immutable access to the AsRef<R>
view of a value. Read more
Mutable access to the AsMut<R>
view of a value. Read more
Immutable access to the Deref::Target
of a value. Read more
Mutable access to the Deref::Target
of a value. Read more
Calls .tap()
only in debug builds, and is erased in release builds.
Calls .tap_mut()
only in debug builds, and is erased in release
builds. Read more
Calls .tap_borrow()
only in debug builds, and is erased in release
builds. Read more
Calls .tap_borrow_mut()
only in debug builds, and is erased in release
builds. Read more
Calls .tap_ref()
only in debug builds, and is erased in release
builds. Read more
Calls .tap_ref_mut()
only in debug builds, and is erased in release
builds. Read more
Calls .tap_deref()
only in debug builds, and is erased in release
builds. Read more
Provides immutable access to the reference for inspection.
Calls tap_ref
in debug builds, and does nothing in release builds.
Provides mutable access to the reference for modification.
Calls tap_ref_mut
in debug builds, and does nothing in release builds.
Provides immutable access to the borrow for inspection. Read more
Calls tap_borrow
in debug builds, and does nothing in release builds.
fn tap_borrow_mut<F, R>(self, func: F) -> Self where
Self: BorrowMut<T>,
F: FnOnce(&mut T) -> R,
fn tap_borrow_mut<F, R>(self, func: F) -> Self where
Self: BorrowMut<T>,
F: FnOnce(&mut T) -> R,
Provides mutable access to the borrow for modification.
Immutably dereferences self
for inspection.
fn tap_deref_dbg<F, R>(self, func: F) -> Self where
Self: Deref,
F: FnOnce(&Self::Target) -> R,
fn tap_deref_dbg<F, R>(self, func: F) -> Self where
Self: Deref,
F: FnOnce(&Self::Target) -> R,
Calls tap_deref
in debug builds, and does nothing in release builds.
fn tap_deref_mut<F, R>(self, func: F) -> Self where
Self: DerefMut,
F: FnOnce(&mut Self::Target) -> R,
fn tap_deref_mut<F, R>(self, func: F) -> Self where
Self: DerefMut,
F: FnOnce(&mut Self::Target) -> R,
Mutably dereferences self
for modification.
The counterpart to unchecked_from
.
Consume self to return an equivalent value of T
.
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more