Struct dex_stable::pallet::Pallet
source · pub struct Pallet<T>(_);
Expand description
The Pallet
struct, the main type that implements traits and standalone
functions within the pallet.
Implementations§
source§impl<T: Config> Pallet<T>
impl<T: Config> Pallet<T>
pub fn get_virtual_price(pool_id: T::PoolId) -> u128
pub fn get_a(pool_id: T::PoolId) -> u128
pub fn get_a_precise_by_id(pool_id: T::PoolId) -> u128
pub fn get_currencies(pool_id: T::PoolId) -> Vec<T::CurrencyId>
pub fn get_currency_index( pool_id: T::PoolId, currency_id: T::CurrencyId ) -> Option<u32>
pub fn get_currency(pool_id: T::PoolId, index: u32) -> Option<T::CurrencyId>
pub fn get_lp_currency(pool_id: T::PoolId) -> Option<T::CurrencyId>
pub fn get_currency_precision_multipliers(pool_id: T::PoolId) -> Vec<u128>
pub fn get_currency_balances(pool_id: T::PoolId) -> Vec<u128>
pub fn get_number_of_currencies(pool_id: T::PoolId) -> u32
pub fn get_admin_balances(pool_id: T::PoolId) -> Vec<u128>
source§impl<T: Config> Pallet<T>
impl<T: Config> Pallet<T>
sourcepub fn create_base_pool(
origin: OriginFor<T>,
currency_ids: Vec<T::CurrencyId>,
currency_decimals: Vec<u32>,
a: u128,
fee: u128,
admin_fee: u128,
admin_fee_receiver: T::AccountId,
lp_currency_symbol: Vec<u8>
) -> DispatchResult
pub fn create_base_pool( origin: OriginFor<T>, currency_ids: Vec<T::CurrencyId>, currency_decimals: Vec<u32>, a: u128, fee: u128, admin_fee: u128, admin_fee_receiver: T::AccountId, lp_currency_symbol: Vec<u8> ) -> DispatchResult
Create a stable amm pool.
Only admin can create pool.
Argument
currency_ids
: The currencies will be join the created pool.currency_decimals
: The currencies corresponding decimals.lp_currency_id
: The specify lp currency id of the created pool.a
: The initial A of created pool.fee
: The swap fee of created pool.admin_fee
: The admin fee of created pool.admin_fee_receiver
: The admin fee receiver of created pool.lp_currency_symbol
: The symbol of created pool lp currency.lp_currency_decimal
: The decimal of created pool lp currency.
sourcepub fn create_meta_pool(
origin: OriginFor<T>,
currency_ids: Vec<T::CurrencyId>,
currency_decimals: Vec<u32>,
a: u128,
fee: u128,
admin_fee: u128,
admin_fee_receiver: T::AccountId,
lp_currency_symbol: Vec<u8>
) -> DispatchResult
pub fn create_meta_pool( origin: OriginFor<T>, currency_ids: Vec<T::CurrencyId>, currency_decimals: Vec<u32>, a: u128, fee: u128, admin_fee: u128, admin_fee_receiver: T::AccountId, lp_currency_symbol: Vec<u8> ) -> DispatchResult
Create a stable amm meta pool.
Only admin can create pool.
Argument
currency_ids
: The currencies will be join the created pool.currency_decimals
: The currencies corresponding decimals.lp_currency_id
: The specify lp currency id of the created pool.a
: The initial A of created pool.fee
: The swap fee of created pool.admin_fee
: The admin fee of created pool.admin_fee_receiver
: The admin fee receiver of created pool.lp_currency_symbol
: The symbol of created pool lp currency.lp_currency_decimal
: The decimal of created pool lp currency.
sourcepub fn add_liquidity(
origin: OriginFor<T>,
pool_id: T::PoolId,
amounts: Vec<u128>,
min_mint_amount: u128,
to: T::AccountId,
deadline: BlockNumberFor<T>
) -> DispatchResult
pub fn add_liquidity( origin: OriginFor<T>, pool_id: T::PoolId, amounts: Vec<u128>, min_mint_amount: u128, to: T::AccountId, deadline: BlockNumberFor<T> ) -> DispatchResult
Supply amounts of currencies to the pool.
Argument
pool_id
: The id of pool.amounts
: Supply amounts of currencies.min_mint_amount
: The min amount of lp currency get.deadline
: Height of the cutoff block of this transaction
sourcepub fn swap(
origin: OriginFor<T>,
pool_id: T::PoolId,
from_index: u32,
to_index: u32,
in_amount: u128,
min_out_amount: u128,
to: T::AccountId,
deadline: BlockNumberFor<T>
) -> DispatchResult
pub fn swap( origin: OriginFor<T>, pool_id: T::PoolId, from_index: u32, to_index: u32, in_amount: u128, min_out_amount: u128, to: T::AccountId, deadline: BlockNumberFor<T> ) -> DispatchResult
Swap a amounts of currencies to get other.
Argument
pool_id
: The id of pool.from_index
: The index of swap currency id.to_index
: The index of receive currency id.in_amount
: The amounts of currencies swap.min_mint_amount
: The min amount of receive currency.deadline
: Height of the cutoff block of this transaction
sourcepub fn remove_liquidity(
origin: OriginFor<T>,
pool_id: T::PoolId,
lp_amount: u128,
min_amounts: Vec<u128>,
to: T::AccountId,
deadline: BlockNumberFor<T>
) -> DispatchResult
pub fn remove_liquidity( origin: OriginFor<T>, pool_id: T::PoolId, lp_amount: u128, min_amounts: Vec<u128>, to: T::AccountId, deadline: BlockNumberFor<T> ) -> DispatchResult
Remove liquidity from a pool.
Argument
pool_id
: The id of pool.lp_amount
: The amounts of lp currency.min_amounts
: The min amounts of pool’s currencies to get.deadline
: Height of the cutoff block of this transaction
sourcepub fn remove_liquidity_one_currency(
origin: OriginFor<T>,
pool_id: T::PoolId,
lp_amount: u128,
index: u32,
min_amount: u128,
to: T::AccountId,
deadline: BlockNumberFor<T>
) -> DispatchResult
pub fn remove_liquidity_one_currency( origin: OriginFor<T>, pool_id: T::PoolId, lp_amount: u128, index: u32, min_amount: u128, to: T::AccountId, deadline: BlockNumberFor<T> ) -> DispatchResult
Remove liquidity from a pool to get one currency.
Argument
pool_id
: The id of pool.lp_amount
: The amounts of lp currency.index
: The index of receive currency.min_amount
: The min amounts of received currency;deadline
: Height of the cutoff block of this transaction
sourcepub fn remove_liquidity_imbalance(
origin: OriginFor<T>,
pool_id: T::PoolId,
amounts: Vec<u128>,
max_burn_amount: u128,
to: T::AccountId,
deadline: BlockNumberFor<T>
) -> DispatchResult
pub fn remove_liquidity_imbalance( origin: OriginFor<T>, pool_id: T::PoolId, amounts: Vec<u128>, max_burn_amount: u128, to: T::AccountId, deadline: BlockNumberFor<T> ) -> DispatchResult
Remove liquidity from a pool to the specify amounts of currencies.
Argument
pool_id
: The id of pool.amounts
: The specify amounts of receive currencies.max_burn_amount
: The max amount of burned lp currency.deadline
: Height of the cutoff block of this transaction
sourcepub fn add_pool_and_base_pool_liquidity(
origin: OriginFor<T>,
pool_id: T::PoolId,
base_pool_id: T::PoolId,
meta_amounts: Vec<u128>,
base_amounts: Vec<u128>,
min_to_mint: u128,
to: T::AccountId,
deadline: BlockNumberFor<T>
) -> DispatchResult
pub fn add_pool_and_base_pool_liquidity( origin: OriginFor<T>, pool_id: T::PoolId, base_pool_id: T::PoolId, meta_amounts: Vec<u128>, base_amounts: Vec<u128>, min_to_mint: u128, to: T::AccountId, deadline: BlockNumberFor<T> ) -> DispatchResult
Supply amounts of currencies to the pool which contains the lp currency of the base pool.
Argument
pool_id
: The id of pool.base_pool_id
: The id of base pool.meta_amounts
: Supply amounts of currencies to pool. The last element must be zero.base_amounts
: Supply amounts of currencies to base pool.min_to_mint
: The min amount of pool lp currency get.deadline
: Height of the cutoff block of this transaction.
sourcepub fn remove_pool_and_base_pool_liquidity(
origin: OriginFor<T>,
pool_id: T::PoolId,
base_pool_id: T::PoolId,
amount: u128,
min_amounts_meta: Vec<u128>,
min_amounts_base: Vec<u128>,
to: T::AccountId,
deadline: BlockNumberFor<T>
) -> DispatchResult
pub fn remove_pool_and_base_pool_liquidity( origin: OriginFor<T>, pool_id: T::PoolId, base_pool_id: T::PoolId, amount: u128, min_amounts_meta: Vec<u128>, min_amounts_base: Vec<u128>, to: T::AccountId, deadline: BlockNumberFor<T> ) -> DispatchResult
Remove liquidity from a pool which contains the lp currency of the base pool.
Argument
pool_id
: The id of pool.base_pool_id
: The id of base pool.amount
: The amounts of lp currency to burn.min_amounts_meta
: The min amounts of pool’s currencies to get.min_amounts_base
: The min amounts of basic pool’s currencies to get.deadline
: Height of the cutoff block of this transaction.
sourcepub fn remove_pool_and_base_pool_liquidity_one_currency(
origin: OriginFor<T>,
pool_id: T::PoolId,
base_pool_id: T::PoolId,
amount: u128,
i: u32,
min_amount: u128,
to: T::AccountId,
deadline: BlockNumberFor<T>
) -> DispatchResult
pub fn remove_pool_and_base_pool_liquidity_one_currency( origin: OriginFor<T>, pool_id: T::PoolId, base_pool_id: T::PoolId, amount: u128, i: u32, min_amount: u128, to: T::AccountId, deadline: BlockNumberFor<T> ) -> DispatchResult
Remove liquidity from a pool which contains the lp currency of the base pool to get one currency.
Argument
pool_id
: The id of pool.base_pool_id
: The id of base pool.amount
: The amounts of lp currency to burn.i
: The index of target currency in basic pool.min_amount
: The min amounts of received currency.deadline
: Height of the cutoff block of this transaction.
sourcepub fn swap_pool_from_base(
origin: OriginFor<T>,
pool_id: T::PoolId,
base_pool_id: T::PoolId,
in_index: u32,
out_index: u32,
dx: u128,
min_dy: u128,
to: T::AccountId,
deadline: BlockNumberFor<T>
) -> DispatchResult
pub fn swap_pool_from_base( origin: OriginFor<T>, pool_id: T::PoolId, base_pool_id: T::PoolId, in_index: u32, out_index: u32, dx: u128, min_dy: u128, to: T::AccountId, deadline: BlockNumberFor<T> ) -> DispatchResult
Swap the currency from basic pool to get amounts of other currency in pool. to get one currency.
Argument
pool_id
: The id of pool.base_pool_id
: The id of base pool.in_index
: The index of swap currency in basic pool.out_index
: The index of target currency in pool.dx
: The amounts of swap currency.min_dy
: The min amounts of target currency.deadline
: Height of the cutoff block of this transaction.
sourcepub fn swap_pool_to_base(
origin: OriginFor<T>,
pool_id: T::PoolId,
base_pool_id: T::PoolId,
in_index: u32,
out_index: u32,
dx: u128,
min_dy: u128,
to: T::AccountId,
deadline: BlockNumberFor<T>
) -> DispatchResult
pub fn swap_pool_to_base( origin: OriginFor<T>, pool_id: T::PoolId, base_pool_id: T::PoolId, in_index: u32, out_index: u32, dx: u128, min_dy: u128, to: T::AccountId, deadline: BlockNumberFor<T> ) -> DispatchResult
Swap the currency from pool to get amounts of other currency in basic pool. to get one currency.
Argument
pool_id
: The id of pool.base_pool_id
: The id of base pool.in_index
: The index of swap currency in basic pool.out_index
: The index of target currency in pool.dx
: The amounts of swap currency.min_dy
: The min amounts of target currency.deadline
: Height of the cutoff block of this transaction.
pub fn swap_meta_pool_underlying( origin: OriginFor<T>, pool_id: T::PoolId, in_index: u32, out_index: u32, dx: u128, min_dy: u128, to: T::AccountId, deadline: BlockNumberFor<T> ) -> DispatchResult
sourcepub fn update_fee_receiver(
origin: OriginFor<T>,
pool_id: T::PoolId,
fee_receiver: <T::Lookup as StaticLookup>::Source
) -> DispatchResult
pub fn update_fee_receiver( origin: OriginFor<T>, pool_id: T::PoolId, fee_receiver: <T::Lookup as StaticLookup>::Source ) -> DispatchResult
Update admin fee receiver of the pool.
Only called by admin.
Argument
pool_id
: The id of pool.fee_receiver
: The new admin fee receiver of this pool.
sourcepub fn set_swap_fee(
origin: OriginFor<T>,
pool_id: T::PoolId,
new_swap_fee: u128
) -> DispatchResult
pub fn set_swap_fee( origin: OriginFor<T>, pool_id: T::PoolId, new_swap_fee: u128 ) -> DispatchResult
Update fee of the pool.
Only called by admin.
Argument
pool_id
: The id of pool.new_swap_fee
: The new swap fee of this pool.
sourcepub fn set_admin_fee(
origin: OriginFor<T>,
pool_id: T::PoolId,
new_admin_fee: u128
) -> DispatchResult
pub fn set_admin_fee( origin: OriginFor<T>, pool_id: T::PoolId, new_admin_fee: u128 ) -> DispatchResult
Update admin fee of the pool.
Only called by admin.
Argument
pool_id
: The id of pool.new_admin_fee
: The new admin fee of this pool.
sourcepub fn ramp_a(
origin: OriginFor<T>,
pool_id: T::PoolId,
future_a: u128,
future_a_time: u128
) -> DispatchResult
pub fn ramp_a( origin: OriginFor<T>, pool_id: T::PoolId, future_a: u128, future_a_time: u128 ) -> DispatchResult
Start ramping up or down A parameter towards given future_a and future_a_time
Only called by admin. Checks if the change is too rapid, and commits the new A value only when it falls under the limit range.
Argument
pool_id
: The id of pool.future_a
: The new A to ramp towards.future_a_time
: Timestamp when the new A should be reached
sourcepub fn stop_ramp_a(origin: OriginFor<T>, pool_id: T::PoolId) -> DispatchResult
pub fn stop_ramp_a(origin: OriginFor<T>, pool_id: T::PoolId) -> DispatchResult
sourcepub fn withdraw_admin_fee(
origin: OriginFor<T>,
pool_id: T::PoolId
) -> DispatchResult
pub fn withdraw_admin_fee( origin: OriginFor<T>, pool_id: T::PoolId ) -> DispatchResult
Withdraw the admin fee from pool to admin fee receiver.
Can called by anyone.
Argument
pool_id
: The id of pool.
source§impl<T: Config> Pallet<T>
impl<T: Config> Pallet<T>
sourcepub fn next_pool_id() -> T::PoolId
pub fn next_pool_id() -> T::PoolId
An auto-generated getter for NextPoolId
.
source§impl<T: Config> Pallet<T>
impl<T: Config> Pallet<T>
sourcepub fn pools<KArg>(
k: KArg
) -> Option<Pool<T::PoolId, T::CurrencyId, T::AccountId, T::PoolCurrencyLimit, T::PoolCurrencySymbolLimit>>where
KArg: EncodeLike<T::PoolId>,
pub fn pools<KArg>( k: KArg ) -> Option<Pool<T::PoolId, T::CurrencyId, T::AccountId, T::PoolCurrencyLimit, T::PoolCurrencySymbolLimit>>where KArg: EncodeLike<T::PoolId>,
An auto-generated getter for Pools
.
source§impl<T: Config> Pallet<T>
impl<T: Config> Pallet<T>
sourcepub fn lp_currencies<KArg>(k: KArg) -> Option<T::PoolId>where
KArg: EncodeLike<T::CurrencyId>,
pub fn lp_currencies<KArg>(k: KArg) -> Option<T::PoolId>where KArg: EncodeLike<T::CurrencyId>,
An auto-generated getter for LpCurrencies
.
Trait Implementations§
source§impl<T: Config> GetStorageVersion for Pallet<T>
impl<T: Config> GetStorageVersion for Pallet<T>
§type CurrentStorageVersion = NoStorageVersionSet
type CurrentStorageVersion = NoStorageVersionSet
source§fn current_storage_version() -> Self::CurrentStorageVersion
fn current_storage_version() -> Self::CurrentStorageVersion
source§fn on_chain_storage_version() -> StorageVersion
fn on_chain_storage_version() -> StorageVersion
source§impl<T: Config> Hooks<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
impl<T: Config> Hooks<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
§fn on_finalize(_n: BlockNumber)
fn on_finalize(_n: BlockNumber)
§fn on_idle(_n: BlockNumber, _remaining_weight: Weight) -> Weight
fn on_idle(_n: BlockNumber, _remaining_weight: Weight) -> Weight
on_finalize
). Read more§fn on_initialize(_n: BlockNumber) -> Weight
fn on_initialize(_n: BlockNumber) -> Weight
§fn on_runtime_upgrade() -> Weight
fn on_runtime_upgrade() -> Weight
§fn offchain_worker(_n: BlockNumber)
fn offchain_worker(_n: BlockNumber)
§fn integrity_test()
fn integrity_test()
source§impl<T: Config> IntegrityTest for Pallet<T>
impl<T: Config> IntegrityTest for Pallet<T>
source§fn integrity_test()
fn integrity_test()
source§impl<T: Config> OffchainWorker<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
impl<T: Config> OffchainWorker<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn offchain_worker(n: BlockNumberFor<T>)
fn offchain_worker(n: BlockNumberFor<T>)
source§impl<T: Config> OnFinalize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
impl<T: Config> OnFinalize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn on_finalize(n: BlockNumberFor<T>)
fn on_finalize(n: BlockNumberFor<T>)
source§impl<T: Config> OnGenesis for Pallet<T>
impl<T: Config> OnGenesis for Pallet<T>
source§fn on_genesis()
fn on_genesis()
source§impl<T: Config> OnIdle<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
impl<T: Config> OnIdle<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§impl<T: Config> OnInitialize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
impl<T: Config> OnInitialize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn on_initialize(n: BlockNumberFor<T>) -> Weight
fn on_initialize(n: BlockNumberFor<T>) -> Weight
source§impl<T: Config> OnRuntimeUpgrade for Pallet<T>
impl<T: Config> OnRuntimeUpgrade for Pallet<T>
source§fn on_runtime_upgrade() -> Weight
fn on_runtime_upgrade() -> Weight
source§impl<T: Config> PalletInfoAccess for Pallet<T>
impl<T: Config> PalletInfoAccess for Pallet<T>
source§fn module_name() -> &'static str
fn module_name() -> &'static str
source§fn crate_version() -> CrateVersion
fn crate_version() -> CrateVersion
source§impl<T> PartialEq<Pallet<T>> for Pallet<T>
impl<T> PartialEq<Pallet<T>> for Pallet<T>
source§impl<T: Config> StableAmmApi<<T as Config>::PoolId, <T as Config>::CurrencyId, <T as Config>::AccountId, u128> for Pallet<T>
impl<T: Config> StableAmmApi<<T as Config>::PoolId, <T as Config>::CurrencyId, <T as Config>::AccountId, u128> for Pallet<T>
fn stable_amm_calculate_currency_amount( pool_id: T::PoolId, amounts: &[u128], deposit: bool ) -> Result<u128, DispatchError>
fn stable_amm_calculate_remove_liquidity( pool_id: T::PoolId, amount: u128 ) -> Option<Vec<u128>>
fn stable_amm_calculate_swap_amount( pool_id: T::PoolId, i: usize, j: usize, in_balance: u128 ) -> Option<u128>
fn stable_amm_calculate_remove_liquidity_one_currency( pool_id: T::PoolId, amount: u128, index: u32 ) -> Option<u128>
fn currency_index(pool_id: T::PoolId, currency: T::CurrencyId) -> Option<u32>
fn add_liquidity( who: &T::AccountId, pool_id: T::PoolId, amounts: &[u128], min_mint_amount: u128, to: &T::AccountId ) -> Result<u128, DispatchError>
fn swap( who: &T::AccountId, poo_id: T::PoolId, from_index: u32, to_index: u32, in_amount: u128, min_out_amount: u128, to: &T::AccountId ) -> Result<u128, DispatchError>
fn remove_liquidity( who: &T::AccountId, poo_id: T::PoolId, lp_amount: u128, min_amounts: &[u128], to: &T::AccountId ) -> DispatchResult
fn remove_liquidity_one_currency( who: &T::AccountId, poo_id: T::PoolId, lp_amount: u128, index: u32, min_amount: u128, to: &T::AccountId ) -> Result<u128, DispatchError>
fn remove_liquidity_imbalance( who: &T::AccountId, pool_id: T::PoolId, amounts: &[u128], max_burn_amount: u128, to: &T::AccountId ) -> DispatchResult
fn swap_pool_from_base( who: &T::AccountId, pool_id: T::PoolId, base_pool_id: T::PoolId, in_index: u32, out_index: u32, dx: u128, min_dy: u128, to: &T::AccountId ) -> Result<u128, DispatchError>
fn swap_pool_to_base( who: &T::AccountId, pool_id: T::PoolId, base_pool_id: T::PoolId, in_index: u32, out_index: u32, dx: u128, min_dy: u128, to: &T::AccountId ) -> Result<u128, DispatchError>
source§impl<T: Config> WhitelistedStorageKeys for Pallet<T>
impl<T: Config> WhitelistedStorageKeys for Pallet<T>
source§fn whitelisted_storage_keys() -> Vec<TrackedStorageKey>
fn whitelisted_storage_keys() -> Vec<TrackedStorageKey>
Vec<TrackedStorageKey>
indicating the storage keys that
should be whitelisted during benchmarking. This means that those keys
will be excluded from the benchmarking performance calculation.impl<T> Eq for Pallet<T>
Auto Trait Implementations§
impl<T> RefUnwindSafe for Pallet<T>where T: RefUnwindSafe,
impl<T> Send for Pallet<T>where T: Send,
impl<T> Sync for Pallet<T>where T: Sync,
impl<T> Unpin for Pallet<T>where T: Unpin,
impl<T> UnwindSafe for Pallet<T>where T: UnwindSafe,
Blanket Implementations§
§impl<T> CheckedConversion for T
impl<T> CheckedConversion for T
§fn checked_from<T>(t: T) -> Option<Self>where
Self: TryFrom<T>,
fn checked_from<T>(t: T) -> Option<Self>where Self: TryFrom<T>,
§fn checked_into<T>(self) -> Option<T>where
Self: TryInto<T>,
fn checked_into<T>(self) -> Option<T>where Self: TryInto<T>,
§impl<T> Conv for T
impl<T> Conv for T
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> FmtForward for T
impl<T> FmtForward for T
§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.§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.§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.§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.§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.§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.§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.§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.§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where &'a Self: for<'a> IntoIterator,
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>
§impl<T> IsType<T> for T
impl<T> IsType<T> for T
§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere Self: Sized,
§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 more§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 more§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,
§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,
§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,
self
, then passes self.as_ref()
into the pipe function.§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,
self
, then passes self.as_mut()
into the pipe
function.§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> SaturatedConversion for T
impl<T> SaturatedConversion for T
§fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Selfwhere Self: UniqueSaturatedFrom<T>,
§fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> Twhere Self: UniqueSaturatedInto<T>,
T
. Read more§impl<T> Tap for T
impl<T> Tap for T
§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,
Borrow<B>
of a value. Read more§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,
BorrowMut<B>
of a value. Read more§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,
AsRef<R>
view of a value. Read more§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,
AsMut<R>
view of a value. Read more§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,
Deref::Target
of a value. Read more§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,
Deref::Target
of a value. Read more§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.§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.§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,
.tap_borrow()
only in debug builds, and is erased in release
builds.§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,
.tap_borrow_mut()
only in debug builds, and is erased in release
builds.§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,
.tap_ref()
only in debug builds, and is erased in release
builds.§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,
.tap_ref_mut()
only in debug builds, and is erased in release
builds.§impl<T> TryConv for T
impl<T> TryConv for T
§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere T: UncheckedFrom<S>,
§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
unchecked_from
.§impl<T, S> UniqueSaturatedInto<T> for Swhere
T: Bounded,
S: TryInto<T>,
impl<T, S> UniqueSaturatedInto<T> for Swhere T: Bounded, S: TryInto<T>,
§fn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
T
.