pub struct SpotMarginConfig(/* private fields */);Expand description
Spot margin on the simulated venue: what it lends a spot order, how much, and what it repays.
Off by default: MockExecutionConfig::spot_margin is None, and the venue is a cash account
whose spot orders must be paid for with what it holds. With a configuration, it is a cross
margin account, with one pool of balances shared by every instrument, which lends a spot order
what it lacks and reports each balance’s loan as Binance’s margin account does.
§What it lends, and when
Each spot order has a MarginEffect: its request’s margin_effect, else this
configuration’s margin_effect. An order with MarginEffect::Borrow
that the account cannot pay for with its free balance borrows the shortfall of the asset it
pays with (base for a sell, quote for a buy), or that asset’s
min_borrow if it is more, as Binance does. It borrows when the venue
accepts the order, as Binance does, so a resting limit order or a held market order is lent its
shortfall at once, and the venue holds it against the order as it holds any other balance. What
a minimum borrow lends beyond the shortfall is not held: it is free balance, owed. An asset the
account has never held is opened with the loan.
An order that is cancelled, expires or is refused at its fill before it fills repays what it
borrowed, interest first, and a held market order that fills for less than was held repays the
part of its loan it no longer needs, if auto_repay_at_cancel
is on (the default, as on Binance). One that fills in part and rests the remainder pays for the
part that filled with the account’s own balance first, so the loan is held against the
remainder and repaid if the remainder is cancelled. What a minimum borrow lent beyond the
shortfall is repaid with the rest if the order ends before it fills in full, and stays owed
once it does.
An order with MarginEffect::NoSideEffect or MarginEffect::Repay lends nothing: one it
cannot pay for is rejected as on a cash account. A loan already in the venue’s initial state
is left as it is, and balances still report their loans.
Only spot orders borrow. A CFD’s margin is posted from the quote asset’s free balance, as
without this configuration, and a CFD order carrying MarginEffect::Borrow or
MarginEffect::Repay is refused with
OrderError::UnsupportedMarginEffect.
§How much it lends
A borrow is allowed while the account’s debt, after it, is at most max_leverage − 1 times
the account’s equity. Both are valued in valuation_asset:
- Each asset is valued at the mid of an instrument on the venue that pairs it with the
valuation asset, else that market’s last price, in either direction (
BTC/USDT, or the inverse ofUSDT/BTC). The valuation asset is worth one. A market priced at zero values nothing. - Equity is the sum over assets of
total − borrowed − interest, valued that way, where an asset whose net is positive counts at itsborrow_collateral_ratio: see# Collateral ratios. An asset the venue cannot value counts as no equity, which understates what the account can borrow rather than overstating it. - Debt is the sum over assets of
borrowed + interest, valued the same way. The venue lends nothing while it cannot value a debt, and never lends an asset it cannot value.
An asset given a max_borrow is lent no more than that cap allows as
well: what the account already owes of it, principal plus interest, plus the new loan, is at
most the cap. Both limits apply, and the tighter one decides.
An order that needs more than the leverage limit allows is rejected as unaffordable, with a
reason that says how much the venue would lend. So is one whose asset’s
min_borrow is more than that, since the venue never lends less than the
minimum, and its reason names the minimum too. One that needs more than an asset’s cap allows,
where the cap is the tighter limit, is rejected with
ApiError::BorrowRejected instead: see
with_max_borrow. A max_leverage of one lends nothing, but still
reports each balance’s loan.
It lends nothing while a liquidation is under way: see SpotMarginLiquidation.
§Collateral ratios
An asset can count for less than its full value as collateral, as Binance’s cross margin weights each asset by a collateral ratio. Each asset has two, both one by default:
- a
borrow_collateral_ratio, which the leverage limit above uses, and so what the venue lends; - a
liquidation_collateral_ratio, which the margin level aSpotMarginLiquidationchecks uses.
A ratio applies only to the part of an asset the account holds beyond what it owes of it,
its positive net: ratio × (total − borrowed − interest). What it holds up to what it owes
counts in full, and so do the holdings of an asset it owes more of than it holds. So an
account that holds 2 BTC and owes 1, at a ratio of 0.95, counts the first BTC in full and the
second at 0.95. Debt is never weighted. A ratio of zero counts the asset for nothing beyond
its debt.
In margin-level terms, the account’s collateral is its debt plus its weighted equity, and the
margin level is collateral over debt, as Binance defines it: a borrow is allowed while that
level, with borrow ratios, stays at or above max_leverage / (max_leverage − 1).
An asset’s liquidation ratio may not be below its borrow ratio, so that the borrow ratios are the stricter ones, as on Binance. That keeps a borrow the leverage limit allows from leaving the account at its liquidation level.
§What it repays
Under MarginEffect::Repay, whatever a fill delivers into an asset the account owes repays
that asset’s loan, interest first, then principal, and only the rest becomes free balance. What
a buy delivers is its quantity less any fee charged in base, so a buy of exactly what is owed,
with a base fee, leaves a fee-sized loan. Gross the buy up by the fee to clear it. Under the
other two effects a fill repays nothing: as on Binance, a repay is per order, and nothing
repays a loan automatically.
§Liquidation
Off by default: an account whose debt grows past its equity keeps trading, and nothing closes
its positions. Configured with with_liquidation, the venue repays
every debt once the account’s margin level falls to the configured level, selling what the
account holds as needed. See SpotMarginLiquidation.
§What it does not model
- Isolated margin. One pool of balances backs every instrument.
- Tiered collateral ratios. An asset has one ratio per check, whatever the size of its holding. Binance publishes each ratio in tiers by the holding’s value in USD.
- Conservative borrow prices. The leverage limit values each asset at the same price as the liquidation check. Binance’s borrow check values an asset the account owes at the highest index price over a recent window, and every other asset at the lowest.
- The venue’s lending pool. The venue has whatever it lends: no shared pool runs short, as one can on a real venue whatever the account’s own limits allow.
- Interest, by this configuration alone. A venue given a
MarginInterestModelcharges it; see that trait.
new refuses a max_leverage below one, with_min_borrow
a negative minimum, with_max_borrow a negative cap, the collateral
ratio builders a ratio outside [0, 1] or a liquidation ratio below the borrow ratio,
with_liquidation a liquidation the leverage limit could reach, and
so does deserialising any of them, so a configuration that exists is one the venue can apply.
Serialised, max_leverage, each minimum borrow, each cap and each ratio are decimal strings
("3"), as the crate writes decimals elsewhere, so no precision is lost to a float.
min_borrow, max_borrow, borrow_collateral_ratio and liquidation_collateral_ratio are
maps from asset to amount, each left out when empty, and liquidation is left out when off.
Implementations§
Source§impl SpotMarginConfig
impl SpotMarginConfig
Sourcepub fn new(
valuation_asset: AssetNameExchange,
max_leverage: Decimal,
margin_effect: MarginEffect,
) -> Result<Self, SpotMarginConfigError>
pub fn new( valuation_asset: AssetNameExchange, max_leverage: Decimal, margin_effect: MarginEffect, ) -> Result<Self, SpotMarginConfigError>
Spot margin applying margin_effect to each order that does not carry its own, up to
max_leverage over the account’s equity, valued in valuation_asset.
The effect has no default, so that a configuration says whether the venue may take on debt
for an order. Unused loans are repaid when their order ends unfilled; see
with_auto_repay_at_cancel.
§Errors
Returns SpotMarginConfigError if max_leverage is below one.
Sourcepub fn with_auto_repay_at_cancel(self, auto_repay_at_cancel: bool) -> Self
pub fn with_auto_repay_at_cancel(self, auto_repay_at_cancel: bool) -> Self
This configuration, repaying a loan its order no longer needs (the order was cancelled,
expired or refused at its fill, or a held market order filled for less than was held) when
auto_repay_at_cancel is true, and leaving it owed when false.
On by default, as Binance’s autoRepayAtCancel is. With it off, an unused loan stays owed
until a MarginEffect::Repay order repays it.
Sourcepub fn valuation_asset(&self) -> &AssetNameExchange
pub fn valuation_asset(&self) -> &AssetNameExchange
The asset equity and debt are valued in.
Sourcepub fn max_leverage(&self) -> Decimal
pub fn max_leverage(&self) -> Decimal
The most the account may hold, as a multiple of its equity: its debt may reach
max_leverage − 1 times its equity.
Sourcepub fn margin_effect(&self) -> MarginEffect
pub fn margin_effect(&self) -> MarginEffect
The effect of an order whose request carries none.
Sourcepub fn auto_repay_at_cancel(&self) -> bool
pub fn auto_repay_at_cancel(&self) -> bool
Whether a loan its order no longer needs is repaid. See
with_auto_repay_at_cancel.
Sourcepub fn with_min_borrow(
self,
asset: AssetNameExchange,
min_borrow: Decimal,
) -> Result<Self, SpotMarginConfigError>
pub fn with_min_borrow( self, asset: AssetNameExchange, min_borrow: Decimal, ) -> Result<Self, SpotMarginConfigError>
This configuration, never lending less than min_borrow of asset: a loan of asset
below it is raised to it, as Binance raises a MARGIN_BUY loan to the asset’s
userMinBorrow. A minimum of zero removes it. Replaces any minimum asset had.
No asset has one by default, so each loan is exactly its order’s shortfall. An order its free balance covers borrows nothing, whatever the minimum.
§Errors
Returns SpotMarginConfigError::NegativeMinBorrow if min_borrow is negative.
Sourcepub fn min_borrow(&self, asset: &AssetNameExchange) -> Decimal
pub fn min_borrow(&self, asset: &AssetNameExchange) -> Decimal
The least the venue lends of asset in one loan, zero if it has no minimum. See
with_min_borrow.
Sourcepub fn with_max_borrow(
self,
asset: AssetNameExchange,
max_borrow: Decimal,
) -> Result<Self, SpotMarginConfigError>
pub fn with_max_borrow( self, asset: AssetNameExchange, max_borrow: Decimal, ) -> Result<Self, SpotMarginConfigError>
This configuration, lending asset only while what the account owes of it, principal plus
interest, and the new loan come to at most max_borrow: a fixed cap on the account’s debt
in asset, as Binance caps what a margin account may borrow of each asset
(maxBorrowable’s borrowLimit). Replaces any cap asset had.
No asset has one by default, so only the leverage limit bounds a loan. A cap of zero lends
none of asset. Nor is asset lent once what the cap leaves is below its
min_borrow, since the venue never lends less than the minimum.
§How the cap counts
A borrow is allowed while what the account already owes of asset, loan plus interest,
plus the new loan is at most the cap. Interest the new loan is charged when it is made is
not counted, as the leverage limit does not count it, so it can take the debt just past the
cap. Counting interest is this venue’s rule: Binance does not document whether its limit
counts it.
The cap is the account’s own limit, not the venue’s supply: Binance can also refuse a borrow its limit allows because it has too little of the asset to lend, which this venue does not model.
The mock client reports the cap as
BorrowCapacity::account_limit, from
BorrowCapacityClient::fetch_borrow_capacity.
§Rejection
An order that would borrow past the cap is rejected, never lent less than it needs. Where
the cap allows less than the leverage limit, the rejection is
ApiError::BorrowRejected with
reason BorrowLimitExceeded,
as a live Binance margin client reports Binance’s -3006. Its message names the cap, and
for a sell its available is how much more of the
base asset the venue would lend: zero when that is below the minimum borrow. A buy borrows
the quote asset, in units other than the order’s, so it leaves available unset. Where
the leverage limit is the tighter, the order is rejected as unaffordable, as without a cap.
§Errors
Returns SpotMarginConfigError::NegativeMaxBorrow if max_borrow is negative.
Sourcepub fn max_borrow(&self, asset: &AssetNameExchange) -> Option<Decimal>
pub fn max_borrow(&self, asset: &AssetNameExchange) -> Option<Decimal>
The most the account may owe of asset, principal plus interest, or None if it has no
cap. See with_max_borrow.
Sourcepub fn with_borrow_collateral_ratio(
self,
asset: AssetNameExchange,
ratio: Decimal,
) -> Result<Self, SpotMarginConfigError>
pub fn with_borrow_collateral_ratio( self, asset: AssetNameExchange, ratio: Decimal, ) -> Result<Self, SpotMarginConfigError>
This configuration, counting ratio of what the account holds of asset beyond what it
owes of it as equity when the venue decides how much it lends: the asset’s borrow
collateral ratio, as Binance’s Margin Data page lists one per asset. Replaces any borrow
ratio asset had. See SpotMarginConfig’s # Collateral ratios.
Every asset’s is one by default. A ratio of one removes it.
§Errors
SpotMarginConfigError::CollateralRatioOutOfRange if ratio is outside [0, 1], and
SpotMarginConfigError::LiquidationRatioBelowBorrowRatio if it is above asset’s
liquidation_collateral_ratio.
Sourcepub fn borrow_collateral_ratio(&self, asset: &AssetNameExchange) -> Decimal
pub fn borrow_collateral_ratio(&self, asset: &AssetNameExchange) -> Decimal
The fraction of what the account holds of asset beyond what it owes of it that counts
as equity when the venue decides how much it lends, one if it has none. See
with_borrow_collateral_ratio.
Sourcepub fn with_liquidation_collateral_ratio(
self,
asset: AssetNameExchange,
ratio: Decimal,
) -> Result<Self, SpotMarginConfigError>
pub fn with_liquidation_collateral_ratio( self, asset: AssetNameExchange, ratio: Decimal, ) -> Result<Self, SpotMarginConfigError>
This configuration, counting ratio of what the account holds of asset beyond what it
owes of it as equity in the margin level a SpotMarginLiquidation checks: the asset’s
liquidation collateral ratio, as Binance’s Margin Data page lists one per asset. Replaces
any liquidation ratio asset had. See SpotMarginConfig’s # Collateral ratios.
Every asset’s is one by default. A ratio of one removes it. It has no effect without a
liquidation.
§Errors
SpotMarginConfigError::CollateralRatioOutOfRange if ratio is outside [0, 1], and
SpotMarginConfigError::LiquidationRatioBelowBorrowRatio if it is below asset’s
borrow_collateral_ratio. To set a liquidation ratio
below the asset’s current borrow ratio, lower the borrow ratio first.
Sourcepub fn liquidation_collateral_ratio(&self, asset: &AssetNameExchange) -> Decimal
pub fn liquidation_collateral_ratio(&self, asset: &AssetNameExchange) -> Decimal
The fraction of what the account holds of asset beyond what it owes of it that counts
as equity in the margin level a liquidation checks, one if it has none. See
with_liquidation_collateral_ratio.
Sourcepub fn with_liquidation(
self,
liquidation: SpotMarginLiquidation,
) -> Result<Self, SpotMarginConfigError>
pub fn with_liquidation( self, liquidation: SpotMarginLiquidation, ) -> Result<Self, SpotMarginConfigError>
This configuration, liquidating the account as liquidation says. Replaces any
liquidation it had.
§Errors
Returns SpotMarginConfigError::LiquidationWithinLeverage if a borrow the leverage limit
allows could leave the account at the liquidation level: if max_leverage is above one
and the level is at least max_leverage / (max_leverage − 1), the margin level of an
account borrowed to the limit.
Sourcepub fn liquidation(&self) -> Option<SpotMarginLiquidation>
pub fn liquidation(&self) -> Option<SpotMarginLiquidation>
When the venue liquidates the account, or None if it never does. See
with_liquidation.
Trait Implementations§
Source§impl Clone for SpotMarginConfig
impl Clone for SpotMarginConfig
Source§impl Debug for SpotMarginConfig
impl Debug for SpotMarginConfig
Source§impl<'de> Deserialize<'de> for SpotMarginConfig
impl<'de> Deserialize<'de> for SpotMarginConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for SpotMarginConfig
Source§impl Hash for SpotMarginConfig
impl Hash for SpotMarginConfig
Source§impl Ord for SpotMarginConfig
impl Ord for SpotMarginConfig
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for SpotMarginConfig
impl PartialEq for SpotMarginConfig
Source§impl PartialOrd for SpotMarginConfig
impl PartialOrd for SpotMarginConfig
Source§impl Serialize for SpotMarginConfig
impl Serialize for SpotMarginConfig
impl StructuralPartialEq for SpotMarginConfig
Auto Trait Implementations§
impl Freeze for SpotMarginConfig
impl RefUnwindSafe for SpotMarginConfig
impl Send for SpotMarginConfig
impl Sync for SpotMarginConfig
impl Unpin for SpotMarginConfig
impl UnsafeUnpin for SpotMarginConfig
impl UnwindSafe for SpotMarginConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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,
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,
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,
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,
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,
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,
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,
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,
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> 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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreimpl<T> JsonSchemaMaybe for T
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,
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,
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,
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) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
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) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
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
.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
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.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)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.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)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.