pub enum Call<T: Config> {
Show 13 variants
mint {
internal_asset: T::AssetId,
external_asset: T::AssetId,
external_amount: <<T as Config>::Fungibles as FungiblesInspect<<T as Config>::AccountId>>::Balance,
max_fee: Permill,
},
redeem {
internal_asset: T::AssetId,
external_asset: T::AssetId,
internal_amount: <<T as Config>::Fungibles as FungiblesInspect<<T as Config>::AccountId>>::Balance,
max_fee: Permill,
},
create_psm {
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,
},
remove_psm {
internal_asset: T::AssetId,
},
set_minting_fee {
internal_asset: T::AssetId,
external_asset: T::AssetId,
fee: Permill,
},
set_redemption_fee {
internal_asset: T::AssetId,
external_asset: T::AssetId,
fee: Permill,
},
set_max_debt {
internal_asset: T::AssetId,
value: <<T as Config>::Fungibles as FungiblesInspect<<T as Config>::AccountId>>::Balance,
},
set_asset_status {
internal_asset: T::AssetId,
external_asset: T::AssetId,
status: CircuitBreakerLevel,
},
set_asset_ceiling_weight {
internal_asset: T::AssetId,
external_asset: T::AssetId,
weight: Permill,
},
add_external_asset {
internal_asset: T::AssetId,
external_asset: T::AssetId,
},
remove_external_asset {
internal_asset: T::AssetId,
external_asset: T::AssetId,
},
set_full_admin {
internal_asset: T::AssetId,
new_admin: Box<T::PalletsOrigin>,
},
set_emergency_admin {
internal_asset: T::AssetId,
new_admin: Box<T::PalletsOrigin>,
},
// some variants omitted
}Expand description
Contains a variant per dispatchable extrinsic that this pallet has.
Variants§
mint
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.
Fields
max_fee: Permillredeem
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.
Fields
max_fee: Permillcreate_psm
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
Fields
full_admin: Box<T::PalletsOrigin>emergency_admin: Box<T::PalletsOrigin>fee_destination: T::AccountIdremove_psm
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
set_minting_fee
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.
set_redemption_fee
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.
set_max_debt
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.
Fields
set_asset_status
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.
set_asset_ceiling_weight
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.
add_external_asset
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.
remove_external_asset
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.
set_full_admin
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
set_emergency_admin
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
Implementations§
Source§impl<T: Config> Call<T>
impl<T: Config> Call<T>
Sourcepub fn new_call_variant_mint(
internal_asset: T::AssetId,
external_asset: T::AssetId,
external_amount: <<T as Config>::Fungibles as FungiblesInspect<<T as Config>::AccountId>>::Balance,
max_fee: Permill,
) -> Self
pub fn new_call_variant_mint( internal_asset: T::AssetId, external_asset: T::AssetId, external_amount: <<T as Config>::Fungibles as FungiblesInspect<<T as Config>::AccountId>>::Balance, max_fee: Permill, ) -> Self
Create a call with the variant mint.
Sourcepub fn new_call_variant_redeem(
internal_asset: T::AssetId,
external_asset: T::AssetId,
internal_amount: <<T as Config>::Fungibles as FungiblesInspect<<T as Config>::AccountId>>::Balance,
max_fee: Permill,
) -> Self
pub fn new_call_variant_redeem( internal_asset: T::AssetId, external_asset: T::AssetId, internal_amount: <<T as Config>::Fungibles as FungiblesInspect<<T as Config>::AccountId>>::Balance, max_fee: Permill, ) -> Self
Create a call with the variant redeem.
Sourcepub fn new_call_variant_create_psm(
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,
) -> Self
pub fn new_call_variant_create_psm( 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, ) -> Self
Create a call with the variant create_psm.
Sourcepub fn new_call_variant_remove_psm(internal_asset: T::AssetId) -> Self
pub fn new_call_variant_remove_psm(internal_asset: T::AssetId) -> Self
Create a call with the variant remove_psm.
Sourcepub fn new_call_variant_set_minting_fee(
internal_asset: T::AssetId,
external_asset: T::AssetId,
fee: Permill,
) -> Self
pub fn new_call_variant_set_minting_fee( internal_asset: T::AssetId, external_asset: T::AssetId, fee: Permill, ) -> Self
Create a call with the variant set_minting_fee.
Sourcepub fn new_call_variant_set_redemption_fee(
internal_asset: T::AssetId,
external_asset: T::AssetId,
fee: Permill,
) -> Self
pub fn new_call_variant_set_redemption_fee( internal_asset: T::AssetId, external_asset: T::AssetId, fee: Permill, ) -> Self
Create a call with the variant set_redemption_fee.
Sourcepub fn new_call_variant_set_max_debt(
internal_asset: T::AssetId,
value: <<T as Config>::Fungibles as FungiblesInspect<<T as Config>::AccountId>>::Balance,
) -> Self
pub fn new_call_variant_set_max_debt( internal_asset: T::AssetId, value: <<T as Config>::Fungibles as FungiblesInspect<<T as Config>::AccountId>>::Balance, ) -> Self
Create a call with the variant set_max_debt.
Sourcepub fn new_call_variant_set_asset_status(
internal_asset: T::AssetId,
external_asset: T::AssetId,
status: CircuitBreakerLevel,
) -> Self
pub fn new_call_variant_set_asset_status( internal_asset: T::AssetId, external_asset: T::AssetId, status: CircuitBreakerLevel, ) -> Self
Create a call with the variant set_asset_status.
Sourcepub fn new_call_variant_set_asset_ceiling_weight(
internal_asset: T::AssetId,
external_asset: T::AssetId,
weight: Permill,
) -> Self
pub fn new_call_variant_set_asset_ceiling_weight( internal_asset: T::AssetId, external_asset: T::AssetId, weight: Permill, ) -> Self
Create a call with the variant set_asset_ceiling_weight.
Sourcepub fn new_call_variant_add_external_asset(
internal_asset: T::AssetId,
external_asset: T::AssetId,
) -> Self
pub fn new_call_variant_add_external_asset( internal_asset: T::AssetId, external_asset: T::AssetId, ) -> Self
Create a call with the variant add_external_asset.
Sourcepub fn new_call_variant_remove_external_asset(
internal_asset: T::AssetId,
external_asset: T::AssetId,
) -> Self
pub fn new_call_variant_remove_external_asset( internal_asset: T::AssetId, external_asset: T::AssetId, ) -> Self
Create a call with the variant remove_external_asset.
Sourcepub fn new_call_variant_set_full_admin(
internal_asset: T::AssetId,
new_admin: Box<T::PalletsOrigin>,
) -> Self
pub fn new_call_variant_set_full_admin( internal_asset: T::AssetId, new_admin: Box<T::PalletsOrigin>, ) -> Self
Create a call with the variant set_full_admin.
Sourcepub fn new_call_variant_set_emergency_admin(
internal_asset: T::AssetId,
new_admin: Box<T::PalletsOrigin>,
) -> Self
pub fn new_call_variant_set_emergency_admin( internal_asset: T::AssetId, new_admin: Box<T::PalletsOrigin>, ) -> Self
Create a call with the variant set_emergency_admin.
Trait Implementations§
Source§impl<T: Config> Authorize for Call<T>
impl<T: Config> Authorize for Call<T>
Source§impl<T: Config> CheckIfFeeless for Call<T>
impl<T: Config> CheckIfFeeless for Call<T>
Source§fn is_feeless(&self, origin: &Self::Origin) -> bool
fn is_feeless(&self, origin: &Self::Origin) -> bool
#[pallet::feeless_if]Source§impl<T: Config> Decode for Call<T>
impl<T: Config> Decode for Call<T>
Source§fn decode<__CodecInputEdqy: Input>(
__codec_input_edqy: &mut __CodecInputEdqy,
) -> Result<Self, Error>
fn decode<__CodecInputEdqy: Input>( __codec_input_edqy: &mut __CodecInputEdqy, ) -> Result<Self, Error>
§fn decode_into<I>(
input: &mut I,
dst: &mut MaybeUninit<Self>,
) -> Result<DecodeFinished, Error>where
I: Input,
fn decode_into<I>(
input: &mut I,
dst: &mut MaybeUninit<Self>,
) -> Result<DecodeFinished, Error>where
I: Input,
§fn skip<I>(input: &mut I) -> Result<(), Error>where
I: Input,
fn skip<I>(input: &mut I) -> Result<(), Error>where
I: Input,
§fn encoded_fixed_size() -> Option<usize>
fn encoded_fixed_size() -> Option<usize>
Source§impl<T: Config> Encode for Call<T>
impl<T: Config> Encode for Call<T>
Source§fn size_hint(&self) -> usize
fn size_hint(&self) -> usize
Source§fn encode_to<__CodecOutputEdqy: Output + ?Sized>(
&self,
__codec_dest_edqy: &mut __CodecOutputEdqy,
)
fn encode_to<__CodecOutputEdqy: Output + ?Sized>( &self, __codec_dest_edqy: &mut __CodecOutputEdqy, )
§fn using_encoded<R, F>(&self, f: F) -> R
fn using_encoded<R, F>(&self, f: F) -> R
§fn encoded_size(&self) -> usize
fn encoded_size(&self) -> usize
Source§impl<T: Config> GetCallIndex for Call<T>
impl<T: Config> GetCallIndex for Call<T>
Source§fn get_call_index(&self) -> u8
fn get_call_index(&self) -> u8
Source§fn get_call_indices() -> &'static [u8] ⓘ
fn get_call_indices() -> &'static [u8] ⓘ
GetCallName].Source§impl<T: Config> GetCallName for Call<T>
impl<T: Config> GetCallName for Call<T>
Source§fn get_call_name(&self) -> &'static str
fn get_call_name(&self) -> &'static str
Source§fn get_call_names() -> &'static [&'static str]
fn get_call_names() -> &'static [&'static str]
GetCallIndex].Source§impl<T: Config> GetDispatchInfo for Call<T>
impl<T: Config> GetDispatchInfo for Call<T>
Source§fn get_dispatch_info(&self) -> DispatchInfo
fn get_dispatch_info(&self) -> DispatchInfo
DispatchInfo, containing relevant information of this dispatch. Read moreSource§impl<T> TypeInfo for Call<T>where
PhantomData<(T,)>: TypeInfo + 'static,
T::AssetId: TypeInfo + 'static,
<<T as Config>::Fungibles as FungiblesInspect<<T as Config>::AccountId>>::Balance: TypeInfo + 'static,
Box<T::PalletsOrigin>: TypeInfo + 'static,
T::AccountId: TypeInfo + 'static,
T: Config + 'static,
impl<T> TypeInfo for Call<T>where
PhantomData<(T,)>: TypeInfo + 'static,
T::AssetId: TypeInfo + 'static,
<<T as Config>::Fungibles as FungiblesInspect<<T as Config>::AccountId>>::Balance: TypeInfo + 'static,
Box<T::PalletsOrigin>: TypeInfo + 'static,
T::AccountId: TypeInfo + 'static,
T: Config + 'static,
Source§impl<T: Config> UnfilteredDispatchable for Call<T>
impl<T: Config> UnfilteredDispatchable for Call<T>
Source§type RuntimeOrigin = <T as Config>::RuntimeOrigin
type RuntimeOrigin = <T as Config>::RuntimeOrigin
frame_system::Config::RuntimeOrigin).Source§fn dispatch_bypass_filter(
self,
origin: Self::RuntimeOrigin,
) -> DispatchResultWithPostInfo
fn dispatch_bypass_filter( self, origin: Self::RuntimeOrigin, ) -> DispatchResultWithPostInfo
impl<T: Config> DecodeWithMemTracking for Call<T>where
T::AssetId: DecodeWithMemTracking,
<<T as Config>::Fungibles as FungiblesInspect<<T as Config>::AccountId>>::Balance: DecodeWithMemTracking,
Box<T::PalletsOrigin>: DecodeWithMemTracking,
T::AccountId: DecodeWithMemTracking,
impl<T: Config> EncodeLike for Call<T>
impl<T: Config> Eq for Call<T>
Auto Trait Implementations§
impl<T> Freeze for Call<T>
impl<T> RefUnwindSafe for Call<T>where
<T as Config>::RuntimeEvent: Sized,
<T as Config>::AssetId: RefUnwindSafe,
<<T as Config>::Fungibles as Inspect<<T as Config>::AccountId>>::Balance: RefUnwindSafe,
<T as Config>::AccountId: RefUnwindSafe,
T: RefUnwindSafe,
<T as Config>::PalletsOrigin: RefUnwindSafe,
impl<T> Send for Call<T>
impl<T> Sync for Call<T>
impl<T> Unpin for Call<T>
impl<T> UnwindSafe for Call<T>where
<T as Config>::RuntimeEvent: Sized,
<T as Config>::AssetId: UnwindSafe,
<<T as Config>::Fungibles as Inspect<<T as Config>::AccountId>>::Balance: UnwindSafe,
<T as Config>::AccountId: UnwindSafe,
T: UnwindSafe,
<T as Config>::PalletsOrigin: 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> DecodeAll for Twhere
T: Decode,
impl<T> DecodeAll for Twhere
T: Decode,
§fn decode_all(input: &mut &[u8]) -> Result<T, Error>
fn decode_all(input: &mut &[u8]) -> Result<T, Error>
Self and consume all of the given input data. Read more§impl<T> DecodeLimit for Twhere
T: Decode,
impl<T> DecodeLimit for Twhere
T: Decode,
§impl<T> DecodeWithMemLimit for Twhere
T: DecodeWithMemTracking,
impl<T> DecodeWithMemLimit for Twhere
T: DecodeWithMemTracking,
§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> Hashable for Twhere
T: Codec,
impl<T> Hashable for Twhere
T: Codec,
§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> KeyedVec for Twhere
T: Codec,
impl<T> KeyedVec for Twhere
T: Codec,
§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.