pub struct Pallet<T>(/* private fields */);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>
Sourcepub fn mint(
origin: OriginFor<T>,
internal_asset: T::AssetId,
external_asset: T::AssetId,
external_amount: <<T as Config>::Fungibles as FungiblesInspect<<T as Config>::AccountId>>::Balance,
max_fee: Permill,
) -> DispatchResult
pub fn mint( origin: OriginFor<T>, internal_asset: T::AssetId, external_asset: T::AssetId, external_amount: <<T as Config>::Fungibles as FungiblesInspect<<T as Config>::AccountId>>::Balance, max_fee: Permill, ) -> DispatchResult
Swap external asset for internal on a specific PSM instance.
§Dispatch Origin
Must be Signed by the user performing the swap.
§Details
Transfers external_amount of external_asset from the caller to the
internal_asset’s PSM reserve account, then mints internal_asset to the
caller minus the minting fee. The fee is calculated using ceiling rounding
(mul_ceil), ensuring the protocol never undercharges. The fee is
transferred to PsmInfo::fee_destination of the targeted instance.
§Parameters
internal_asset: The internal stablecoin that identifies the PSM instance.external_asset: The external asset to deposit (must be approved oninternal_asset).external_amount: Amount of external asset to deposit.max_fee: Maximum minting fee rate accepted by the caller.
§Errors
Error::PsmNotFound: If no PSM is registered forinternal_asset.Error::UnsupportedAsset: Ifexternal_assetis not approved on this PSM.Error::MintingStopped: If the per-external circuit breaker is atMintingDisabledor higher.Error::BelowMinimumSwap: If the internal-equivalent ofexternal_amountis below the instance’smin_swap_amount.Error::FeeTooHigh: If the configured minting fee exceedsmax_fee.Error::ExceedsMaxPsmDebt: If minting would exceed this PSM’s debt ceiling (aggregate or per-asset).Error::DecimalsMismatch: If live decimals diverged from the snapshot taken at registration.Error::AmountTooSmallAfterConversion: If the conversion to the counter-asset rounds to zero; swap would transfer nothing.
§Events
Event::Minted: Emitted on successful mint.
Sourcepub fn redeem(
origin: OriginFor<T>,
internal_asset: T::AssetId,
external_asset: T::AssetId,
internal_amount: <<T as Config>::Fungibles as FungiblesInspect<<T as Config>::AccountId>>::Balance,
max_fee: Permill,
) -> DispatchResult
pub fn redeem( origin: OriginFor<T>, internal_asset: T::AssetId, external_asset: T::AssetId, internal_amount: <<T as Config>::Fungibles as FungiblesInspect<<T as Config>::AccountId>>::Balance, max_fee: Permill, ) -> DispatchResult
Swap internal for external asset on a specific PSM instance.
§Dispatch Origin
Must be Signed by the user performing the swap.
§Details
Burns internal_amount of internal_asset from the caller minus fee (transferred
to the instance’s PsmInfo::fee_destination), then transfers the resulting
amount in external_asset from the PSM reserve to the caller. The fee is
calculated using ceiling rounding (mul_ceil), ensuring the protocol never
undercharges. Redemptions use the decimals snapshotted when the PSM/external pair
was registered, allowing existing positions to unwind even if live metadata later
changes.
§Parameters
internal_asset: The internal stablecoin that identifies the PSM instance.external_asset: The external asset to receive (must be approved oninternal_asset).internal_amount: Amount ofinternal_assetto redeem.max_fee: Maximum redemption fee rate accepted by the caller.
§Errors
Error::PsmNotFound: If no PSM is registered forinternal_asset.Error::UnsupportedAsset: Ifexternal_assetis not approved on this PSM.Error::AllSwapsStopped: If the per-external circuit breaker is atAllDisabled.Error::BelowMinimumSwap: Ifinternal_amountis below the instance’smin_swap_amount.Error::FeeTooHigh: If the configured redemption fee exceedsmax_fee.Error::InsufficientReserve: If the PSM holds less ofexternal_assetthan the redemption requires.Error::AmountTooSmallAfterConversion: If the conversion to the counter-asset rounds to zero; swap would transfer nothing.
§Events
Event::Redeemed: Emitted on successful redemption.
Sourcepub fn create_psm(
origin: OriginFor<T>,
internal_asset: T::AssetId,
full_admin: Box<T::PalletsOrigin>,
emergency_admin: Box<T::PalletsOrigin>,
fee_destination: T::AccountId,
max_debt: <<T as Config>::Fungibles as FungiblesInspect<<T as Config>::AccountId>>::Balance,
min_swap_amount: <<T as Config>::Fungibles as FungiblesInspect<<T as Config>::AccountId>>::Balance,
) -> DispatchResult
pub fn create_psm( origin: OriginFor<T>, internal_asset: T::AssetId, full_admin: Box<T::PalletsOrigin>, emergency_admin: Box<T::PalletsOrigin>, fee_destination: T::AccountId, max_debt: <<T as Config>::Fungibles as FungiblesInspect<<T as Config>::AccountId>>::Balance, min_swap_amount: <<T as Config>::Fungibles as FungiblesInspect<<T as Config>::AccountId>>::Balance, ) -> DispatchResult
Create a PSM for a given internal asset.
If Config::CreateOrigin resolves to Some(account), takes a
Config::Consideration deposit from that account for the instance’s footprint
(refunded on remove_psm). If it resolves to None, no deposit is taken. The
full_admin and emergency_admin origins are set from the provided arguments and may
later be reassigned via Pallet::set_full_admin / Pallet::set_emergency_admin.
§Dispatch Origin
Config::CreateOrigin, parameterised by internal_asset. With the recommended
EnsureAssetOwner this is a signed origin that owns internal_asset.
§Parameters
internal_asset: The internal stablecoin keying the new PSM. Must exist in the fungibles backend; must not already have a PSM registered.full_admin: Origin granted full management of the new PSM.emergency_admin: Origin granted emergency management of the new PSM.fee_destination: Account that will receive mint/redeem fees.max_debt: Initial absolute internal-asset debt ceiling.min_swap_amount: Minimum swap amount for this instance, in internal-asset units. Must be non-zero.
§Errors
- [
DispatchError::BadOrigin]: The origin is not permitted byConfig::CreateOrigin. Error::PsmAlreadyExists: A PSM is already registered forinternal_asset.Error::ZeroMinSwapAmount:min_swap_amountis zero.Error::AssetDoesNotExist: The internal asset does not exist.- Any error from establishing the
Config::Considerationdeposit when one is needed (e.g. the account cannot afford it).
§Events
Sourcepub fn remove_psm(
origin: OriginFor<T>,
internal_asset: T::AssetId,
) -> DispatchResult
pub fn remove_psm( origin: OriginFor<T>, internal_asset: T::AssetId, ) -> DispatchResult
Remove a PSM. Callable by the current full_admin. All approved externals
must be removed first and aggregate PSM debt must be zero.
If a creation deposit was taken, it is always returned to the account that originally paid it, regardless of any later admin reassignment.
§Dispatch Origin
Must match the PSM’s full_admin.
§Parameters
internal_asset: The PSM instance to remove.
§Errors
Error::PsmNotFound: No PSM is registered forinternal_asset.Error::PsmHasApprovedExternals: Approved externals still exist.Error::PsmHasDebt: Outstanding aggregate debt is non-zero.
§Events
Sourcepub fn set_minting_fee(
origin: OriginFor<T>,
internal_asset: T::AssetId,
external_asset: T::AssetId,
fee: Permill,
) -> DispatchResult
pub fn set_minting_fee( origin: OriginFor<T>, internal_asset: T::AssetId, external_asset: T::AssetId, fee: Permill, ) -> DispatchResult
Set the minting fee for an (internal_asset, external_asset) pair.
§Dispatch Origin
Must match the PSM instance’s full_admin (the Full privilege level).
§Parameters
internal_asset: The PSM instance to configure.external_asset: The external asset whose minting fee is being updated.fee: The new minting fee.
§Errors
Error::InsufficientPrivilege: If the origin only hasEmergencyprivileges.Error::AssetNotApproved: Ifexternal_assetis not approved oninternal_asset.
§Events
Event::MintingFeeUpdated: Emitted with old and new values.
Sourcepub fn set_redemption_fee(
origin: OriginFor<T>,
internal_asset: T::AssetId,
external_asset: T::AssetId,
fee: Permill,
) -> DispatchResult
pub fn set_redemption_fee( origin: OriginFor<T>, internal_asset: T::AssetId, external_asset: T::AssetId, fee: Permill, ) -> DispatchResult
Set the redemption fee for an (internal_asset, external_asset) pair.
§Dispatch Origin
Must match the PSM instance’s full_admin (the Full privilege level).
§Parameters
internal_asset: The PSM instance to configure.external_asset: The external asset whose redemption fee is being updated.fee: The new redemption fee.
§Errors
Error::InsufficientPrivilege: If the origin only hasEmergencyprivileges.Error::AssetNotApproved: Ifexternal_assetis not approved oninternal_asset.
§Events
Event::RedemptionFeeUpdated: Emitted with old and new values.
Sourcepub fn set_max_debt(
origin: OriginFor<T>,
internal_asset: T::AssetId,
value: <<T as Config>::Fungibles as FungiblesInspect<<T as Config>::AccountId>>::Balance,
) -> DispatchResult
pub fn set_max_debt( origin: OriginFor<T>, internal_asset: T::AssetId, value: <<T as Config>::Fungibles as FungiblesInspect<<T as Config>::AccountId>>::Balance, ) -> DispatchResult
Set the PSM debt ceiling per internal asset, shared across all approved external assets.
§Dispatch Origin
Must match the PSM instance’s full_admin; only the Full privilege level may use
this call.
§Parameters
internal_asset: The PSM instance to configure.value: The new absolute debt ceiling, in internal-asset units.
§Errors
Error::InsufficientPrivilege: If the origin level cannot set the debt ceiling.Error::PsmNotFound: If no PSM is registered forinternal_asset.
§Events
Event::MaxDebtUpdated: Emitted with old and new values.
Sourcepub fn set_asset_status(
origin: OriginFor<T>,
internal_asset: T::AssetId,
external_asset: T::AssetId,
status: CircuitBreakerLevel,
) -> DispatchResult
pub fn set_asset_status( origin: OriginFor<T>, internal_asset: T::AssetId, external_asset: T::AssetId, status: CircuitBreakerLevel, ) -> DispatchResult
Set the circuit breaker per external asset on a PSM instance.
§Dispatch Origin
Must match the PSM instance’s full_admin or emergency_admin; either the
Full or Emergency privilege level may use this call.
§Parameters
internal_asset: The PSM instance to configure.external_asset: The external asset whose status is being updated.status: The new circuit breaker level for that external.
§Errors
Error::AssetNotApproved: Ifexternal_assetis not approved oninternal_asset.
§Events
Event::AssetStatusUpdated: Emitted on a successful update.
Sourcepub fn set_asset_ceiling_weight(
origin: OriginFor<T>,
internal_asset: T::AssetId,
external_asset: T::AssetId,
weight: Permill,
) -> DispatchResult
pub fn set_asset_ceiling_weight( origin: OriginFor<T>, internal_asset: T::AssetId, external_asset: T::AssetId, weight: Permill, ) -> DispatchResult
Set the ceiling weight per external asset on a PSM instance.
Weights are normalised against the sum of weights within the same instance:
max_asset_debt = (weight / sum_of_weights) * info.max_debt.
§Dispatch Origin
Must match the PSM instance’s full_admin; only the Full privilege level may use
this call.
§Parameters
internal_asset: The PSM instance to configure.external_asset: The external asset whose ceiling weight is being updated.weight: The new ceiling weight. Zero disables minting for this external.
§Errors
Error::InsufficientPrivilege: If the origin level cannot set ceiling weights.Error::AssetNotApproved: Ifexternal_assetis not approved oninternal_asset.
§Events
Event::AssetCeilingWeightUpdated: Emitted with old and new values.
Sourcepub fn add_external_asset(
origin: OriginFor<T>,
internal_asset: T::AssetId,
external_asset: T::AssetId,
) -> DispatchResult
pub fn add_external_asset( origin: OriginFor<T>, internal_asset: T::AssetId, external_asset: T::AssetId, ) -> DispatchResult
Approve an external asset for a given internal asset.
Snapshots the external asset’s live decimals at registration time and
increments PsmInfo::external_count.
§Dispatch Origin
Must match the PSM instance’s full_admin (the Full privilege level).
§Parameters
internal_asset: The PSM instance to approve the external on.external_asset: The external asset to approve.
§Errors
Error::InsufficientPrivilege: If the origin only hasEmergencyprivileges.Error::PsmNotFound: If no PSM is registered forinternal_asset.Error::TooManyAssets: If the PSM is already atConfig::MaxExternals.Error::AssetAlreadyApproved: Ifexternal_assetis already approved on this PSM.Error::AssetDoesNotExist: Ifexternal_assetdoes not exist in the underlying fungibles backend.Error::DecimalsMismatch: If the internal asset’s live decimals diverged from the snapshot inPsmInfo.Error::DecimalsRangeExceeded: If|asset_decimals − internal_decimals|exceedsMAX_DECIMALS_DIFF.
§Events
Event::ExternalAssetAdded: Emitted on a successful approval.
Sourcepub fn remove_external_asset(
origin: OriginFor<T>,
internal_asset: T::AssetId,
external_asset: T::AssetId,
) -> DispatchResult
pub fn remove_external_asset( origin: OriginFor<T>, internal_asset: T::AssetId, external_asset: T::AssetId, ) -> DispatchResult
Remove an external asset from a PSM instance.
Wipes the external’s per-instance state (status, decimals, fees, ceiling
weight, debt counter) and decrements PsmInfo::external_count. The
external must have zero outstanding debt on this instance.
§Dispatch Origin
Must match the PSM instance’s full_admin (the Full privilege level).
§Parameters
internal_asset: The PSM instance to remove the external from.external_asset: The external asset to remove.
§Errors
Error::InsufficientPrivilege: If the origin only hasEmergencyprivileges.Error::PsmNotFound: If no PSM is registered forinternal_asset.Error::AssetNotApproved: Ifexternal_assetis not approved on this PSM.Error::AssetHasDebt: If the external still has non-zero outstanding debt.
§Events
Event::ExternalAssetRemoved: Emitted on a successful removal.
Sourcepub fn set_full_admin(
origin: OriginFor<T>,
internal_asset: T::AssetId,
new_admin: Box<T::PalletsOrigin>,
) -> DispatchResult
pub fn set_full_admin( origin: OriginFor<T>, internal_asset: T::AssetId, new_admin: Box<T::PalletsOrigin>, ) -> DispatchResult
Reassign the PSM’s full_admin. Callable by the current full_admin.
§Dispatch Origin
Must match the PSM’s current full_admin.
§Parameters
internal_asset: The PSM whosefull_adminis being changed.new_admin: The newfull_adminorigin.
§Errors
Error::PsmNotFound: No PSM is registered forinternal_asset.
§Events
Sourcepub fn set_emergency_admin(
origin: OriginFor<T>,
internal_asset: T::AssetId,
new_admin: Box<T::PalletsOrigin>,
) -> DispatchResult
pub fn set_emergency_admin( origin: OriginFor<T>, internal_asset: T::AssetId, new_admin: Box<T::PalletsOrigin>, ) -> DispatchResult
Reassign the PSM’s emergency_admin. Callable by the current full_admin.
§Dispatch Origin
Must match the PSM’s current full_admin.
§Parameters
internal_asset: The PSM whoseemergency_adminis being changed.new_admin: The newemergency_adminorigin.
§Errors
Error::PsmNotFound: No PSM is registered forinternal_asset.
§Events
Trait Implementations§
Source§impl<T: Config> BeforeAllRuntimeMigrations for Pallet<T>
impl<T: Config> BeforeAllRuntimeMigrations for Pallet<T>
Source§fn before_all_runtime_migrations() -> Weight
fn before_all_runtime_migrations() -> Weight
Source§impl<T> Benchmarking for Pallet<T>
Available on crate features runtime-benchmarks only.
impl<T> Benchmarking for Pallet<T>
runtime-benchmarks only.Source§impl<T: Config> GetStorageVersion for Pallet<T>
impl<T: Config> GetStorageVersion for Pallet<T>
Source§type InCodeStorageVersion = StorageVersion
type InCodeStorageVersion = StorageVersion
Source§fn in_code_storage_version() -> Self::InCodeStorageVersion
fn in_code_storage_version() -> Self::InCodeStorageVersion
storage_version attribute, or
[NoStorageVersionSet] if the attribute is missing.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>
Source§fn integrity_test()
fn integrity_test()
Source§fn try_state(_n: BlockNumberFor<T>) -> Result<(), TryRuntimeError>
fn try_state(_n: BlockNumberFor<T>) -> Result<(), TryRuntimeError>
§fn on_initialize(_n: BlockNumber) -> Weight
fn on_initialize(_n: BlockNumber) -> Weight
§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
Hooks::on_finalize]). Read more§fn on_poll(_n: BlockNumber, _weight: &mut WeightMeter)
fn on_poll(_n: BlockNumber, _weight: &mut WeightMeter)
§fn on_runtime_upgrade() -> Weight
fn on_runtime_upgrade() -> Weight
Executive pallet. Read more§fn pre_upgrade() -> Result<Vec<u8>, DispatchError>
fn pre_upgrade() -> Result<Vec<u8>, DispatchError>
§fn post_upgrade(_state: Vec<u8>) -> Result<(), DispatchError>
fn post_upgrade(_state: Vec<u8>) -> Result<(), DispatchError>
§fn offchain_worker(_n: BlockNumber)
fn offchain_worker(_n: BlockNumber)
Source§impl<T: Config> IntegrityTest for Pallet<T>
impl<T: Config> IntegrityTest for Pallet<T>
Source§fn integrity_test()
fn integrity_test()
Hooks::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>)
Hooks::on_finalize].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
Hooks::on_initialize].Source§impl<T: Config> OnPoll<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
impl<T: Config> OnPoll<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
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
Hooks::on_runtime_upgrade].§fn try_on_runtime_upgrade(checks: bool) -> Result<Weight, DispatchError>
fn try_on_runtime_upgrade(checks: bool) -> Result<Weight, DispatchError>
pre_upgrade ->
on_runtime_upgrade -> post_upgrade hooks for a migration. Read moreSource§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: Config> TryState<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
impl<T: Config> TryState<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
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> Freeze for Pallet<T>
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§
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
§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>,
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Conv for T
impl<T> Conv for T
§impl<T, U> DefensiveTruncateInto<U> for Twhere
U: DefensiveTruncateFrom<T>,
impl<T, U> DefensiveTruncateInto<U> for Twhere
U: DefensiveTruncateFrom<T>,
§fn defensive_truncate_into(self) -> U
fn defensive_truncate_into(self) -> U
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§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 Q
impl<Q, K> Equivalent<K> for Q
§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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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 more§impl<Src, Dest> IntoTuple<Dest> for Srcwhere
Dest: FromTuple<Src>,
impl<Src, Dest> IntoTuple<Dest> for Srcwhere
Dest: FromTuple<Src>,
fn into_tuple(self) -> Dest
§impl<T> IsType<T> for T
impl<T> IsType<T> for T
§impl<T, Outer> IsWrappedBy<Outer> for T
impl<T, Outer> IsWrappedBy<Outer> 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) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
§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
§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.§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.§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.§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<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.§impl<T> Tap for T
impl<T> Tap for T
§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 more§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 more§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 more§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 more§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 more§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 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)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.§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.§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.§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.§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.§impl<T> TryConv for T
impl<T> TryConv for T
§impl<T, U> TryIntoKey<U> for Twhere
U: TryFromKey<T>,
impl<T, U> TryIntoKey<U> for Twhere
U: TryFromKey<T>,
type Error = <U as TryFromKey<T>>::Error
fn try_into_key(self) -> Result<U, <U as TryFromKey<T>>::Error>
§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 S
impl<T, S> UniqueSaturatedInto<T> for S
§fn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
T.