pub struct Pallet<T>(/* private fields */);
Expand description

Pallet for parachain staking.

Implementations§

source§

impl<T: Config> Pallet<T>

source

pub fn get_unclaimed_staking_rewards( acc: &T::AccountId ) -> <<T as Config>::Currency as Inspect<<T as Config>::AccountId>>::Balance

Calculates the staking rewards for a given account address.

Subtracts the number of rewarded blocks from the number of authored blocks by the collator and multiplies that with the current stake as well as reward rate.

At least used in Runtime API.

source

pub fn get_staking_rates() -> StakingRates

Calculates the current staking and reward rates for collators and delegators.

At least used in Runtime API.

source§

impl<T: Config> Pallet<T>

source

pub fn force_new_round(origin: OriginFor<T>) -> DispatchResult

Forces the start of the new round in the next block.

The new round will be enforced via <T as ShouldEndSession<_>>::should_end_session.

The dispatch origin must be Root.

source

pub fn set_inflation( origin: OriginFor<T>, collator_max_rate_percentage: Perquintill, collator_annual_reward_rate_percentage: Perquintill, delegator_max_rate_percentage: Perquintill, delegator_annual_reward_rate_percentage: Perquintill ) -> DispatchResultWithPostInfo

Set the annual inflation rate to derive per-round inflation.

The inflation details are considered valid if the annual reward rate is approximately the per-block reward rate multiplied by the estimated* total number of blocks per year.

The estimated average block time is twelve seconds.

NOTE: Iterates over CandidatePool and for each candidate over their delegators to update their rewards before the reward rates change. Needs to be improved when scaling up MaxTopCandidates.

The dispatch origin must be Root.

Emits RoundInflationSet.

source

pub fn set_max_selected_candidates( origin: OriginFor<T>, new: u32 ) -> DispatchResultWithPostInfo

Set the maximum number of collator candidates that can be selected at the beginning of each validation round.

Changes are not applied until the start of the next round.

The new value must be higher than the minimum allowed as set in the pallet’s configuration.

The dispatch origin must be Root.

Emits MaxSelectedCandidatesSet.

source

pub fn set_blocks_per_round( origin: OriginFor<T>, new: BlockNumberFor<T> ) -> DispatchResult

Set the number of blocks each validation round lasts.

If the new value is less than the length of the current round, the system will immediately move to the next round in the next block.

The new value must be higher than the minimum allowed as set in the pallet’s configuration.

The dispatch origin must be Root.

Emits BlocksPerRoundSet.

source

pub fn set_max_candidate_stake( origin: OriginFor<T>, new: <<T as Config>::Currency as Inspect<<T as Config>::AccountId>>::Balance ) -> DispatchResult

Set the maximal amount a collator can stake. Existing stakes are not changed.

The dispatch origin must be Root.

Emits MaxCandidateStakeChanged.

source

pub fn force_remove_candidate( origin: OriginFor<T>, collator: <T::Lookup as StaticLookup>::Source ) -> DispatchResultWithPostInfo

Forcedly removes a collator candidate from the TopCandidates and clears all associated storage for the candidate and their delegators.

Prepares unstaking of the candidates and their delegators stake which can be unfreezed via unlock_unstaked after waiting at least StakeDuration many blocks. Also increments rewards for the collator and their delegators.

Increments rewards of candidate and their delegators.

Emits CandidateRemoved.

source

pub fn join_candidates( origin: OriginFor<T>, stake: <<T as Config>::Currency as Inspect<<T as Config>::AccountId>>::Balance ) -> DispatchResultWithPostInfo

Join the set of collator candidates.

In the next blocks, if the collator candidate has enough funds staked to be included in any of the top MaxSelectedCandidates positions, it will be included in the set of potential authors that will be selected by the stake-weighted random selection function.

The staked funds of the new collator candidate are added to the total stake of the system.

The total amount of funds staked must be within the allowed range as set in the pallet’s configuration.

The dispatch origin must not be already part of the collator candidates nor of the delegators set.

Emits JoinedCollatorCandidates.

source

pub fn init_leave_candidates(origin: OriginFor<T>) -> DispatchResultWithPostInfo

Request to leave the set of collator candidates.

On success, the account is immediately removed from the candidate pool to prevent selection as a collator in future validation rounds, but unstaking of the funds is executed with a delay of StakeDuration blocks.

The exit request can be reversed by calling cancel_leave_candidates.

This operation affects the pallet’s total stake amount. It is updated even though the funds of the candidate who signaled to leave are still locked for ExitDelay + StakeDuration more blocks.

NOTE 1: Upon starting a new session_i in new_session, the current top candidates are selected to be block authors for session_i+1. Any changes to the top candidates afterwards do not effect the set of authors for session_i+1. Thus, we have to make sure none of these collators can leave before session_i+1 ends by delaying their exit for ExitDelay many blocks.

NOTE 2: We do not increment rewards in this extrinsic as the candidate could still author blocks, and thus be eligible to receive rewards, until the end of the next session.

Emits CollatorScheduledExit.

source

pub fn execute_leave_candidates( origin: OriginFor<T>, collator: <T::Lookup as StaticLookup>::Source ) -> DispatchResultWithPostInfo

Execute the network exit of a candidate who requested to leave at least ExitQueueDelay rounds ago. Prepares unstaking of the candidates and their delegators stake which can be unfreezed via unlock_unstaked after waiting at least StakeDuration many blocks.

Requires the candidate to previously have called init_leave_candidates.

The exit request can be reversed by calling cancel_leave_candidates.

NOTE: Iterates over CandidatePool for each candidate over their delegators to set rewards. Needs to be improved when scaling up MaxTopCandidates.

Emits CollatorLeft.

source

pub fn cancel_leave_candidates( origin: OriginFor<T> ) -> DispatchResultWithPostInfo

Revert the previously requested exit of the network of a collator candidate. On success, adds back the candidate to the TopCandidates and updates the collators.

Requires the candidate to previously have called init_leave_candidates.

Emits CollatorCanceledExit.

source

pub fn candidate_stake_more( origin: OriginFor<T>, more: <<T as Config>::Currency as Inspect<<T as Config>::AccountId>>::Balance ) -> DispatchResultWithPostInfo

Stake more funds for a collator candidate.

If not in the set of candidates, staking enough funds allows the account to be added to it. The larger amount of funds, the higher chances to be selected as the author of the next block.

This operation affects the pallet’s total stake amount.

The resulting total amount of funds staked must be within the allowed range as set in the pallet’s configuration.

Emits CollatorStakedMore.

source

pub fn candidate_stake_less( origin: OriginFor<T>, less: <<T as Config>::Currency as Inspect<<T as Config>::AccountId>>::Balance ) -> DispatchResultWithPostInfo

Stake less funds for a collator candidate.

If the new amount of staked fund is not large enough, the account could be removed from the set of collator candidates and not be considered for authoring the next blocks.

This operation affects the pallet’s total stake amount.

The unstaked funds are not released immediately to the account, but they will be available after StakeDuration blocks.

The resulting total amount of funds staked must be within the allowed range as set in the pallet’s configuration.

Emits CollatorStakedLess.

source

pub fn join_delegators( origin: OriginFor<T>, collator: <T::Lookup as StaticLookup>::Source, amount: <<T as Config>::Currency as Inspect<<T as Config>::AccountId>>::Balance ) -> DispatchResultWithPostInfo

Join the set of delegators by delegating to a collator candidate.

The account that wants to delegate cannot be part of the collator candidates set as well.

The caller must not have a delegation. If that is the case, they are required to first remove the delegation.

The amount staked must be larger than the minimum required to become a delegator as set in the pallet’s configuration.

As only MaxDelegatorsPerCollator are allowed to delegate a given collator, the amount staked must be larger than the lowest one in the current set of delegator for the operation to be meaningful.

The collator’s total stake as well as the pallet’s total stake are increased accordingly.

Emits Delegation. Emits DelegationReplaced if the candidate has MaxDelegatorsPerCollator many delegations but this delegator staked more than one of the other delegators of this candidate.

source

pub fn leave_delegators(origin: OriginFor<T>) -> DispatchResultWithPostInfo

Leave the set of delegators and, by implication, revoke the ongoing delegation.

All staked funds are not unlocked immediately, but they are added to the queue of pending unstaking, and will effectively be released after StakeDuration blocks from the moment the delegator leaves.

This operation reduces the total stake of the pallet as well as the stakes of all collators that were delegated, potentially affecting their chances to be included in the set of candidates in the next rounds.

Automatically increments the accumulated rewards of the origin of the current delegation.

Emits DelegatorLeft.

source

pub fn delegator_stake_more( origin: OriginFor<T>, more: <<T as Config>::Currency as Inspect<<T as Config>::AccountId>>::Balance ) -> DispatchResultWithPostInfo

Increase the stake for delegating a collator candidate.

If not in the set of candidates, staking enough funds allows the collator candidate to be added to it.

Emits DelegatorStakedMore.

source

pub fn delegator_stake_less( origin: OriginFor<T>, less: <<T as Config>::Currency as Inspect<<T as Config>::AccountId>>::Balance ) -> DispatchResultWithPostInfo

Reduce the stake for delegating a collator candidate.

If the new amount of staked fund is not large enough, the collator could be removed from the set of collator candidates and not be considered for authoring the next blocks.

The unstaked funds are not release immediately to the account, but they will be available after StakeDuration blocks.

The remaining staked funds must still be larger than the minimum required by this pallet to maintain the status of delegator.

The resulting total amount of funds staked must be within the allowed range as set in the pallet’s configuration.

Emits DelegatorStakedLess.

source

pub fn unlock_unstaked( origin: OriginFor<T>, target: <T::Lookup as StaticLookup>::Source ) -> DispatchResultWithPostInfo

Unlock all previously staked funds that are now available for unlocking by the origin account after StakeDuration blocks have elapsed.

source

pub fn claim_rewards(origin: OriginFor<T>) -> DispatchResult

Claim block authoring rewards for the target address.

Requires Rewards to be set beforehand, which can by triggered by any of the following options

  • Calling increment_{collator, delegator}_rewards (active)
  • Altering your stake (active)
  • Leaving the network as a collator (active)
  • Revoking a delegation as a delegator (active)
  • Being a delegator whose collator left the network, altered their stake or incremented rewards (passive)

The dispatch origin can be any signed one, e.g., anyone can claim for anyone.

Emits Rewarded.

source

pub fn increment_collator_rewards(origin: OriginFor<T>) -> DispatchResult

Actively increment the rewards of a collator.

The same effect is triggered by changing the stake or leaving the network.

The dispatch origin must be a collator.

source

pub fn increment_delegator_rewards(origin: OriginFor<T>) -> DispatchResult

Actively increment the rewards of a delegator.

The same effect is triggered by changing the stake or revoking delegations.

The dispatch origin must be a delegator.

source

pub fn execute_scheduled_reward_change( origin: OriginFor<T> ) -> DispatchResultWithPostInfo

Executes the annual reduction of the reward rates for collators and delegators.

Moreover, sets rewards for all collators and delegators before adjusting the inflation.

The dispatch origin can be any signed one because we bail if called too early.

Emits RoundInflationSet.

source§

impl<T: Config> Pallet<T>

source

pub fn is_delegator(acc: &T::AccountId) -> bool

Check whether an account is currently delegating.

source

pub fn is_active_candidate(acc: &T::AccountId) -> Option<bool>

Check whether an account is currently a collator candidate and whether their state is CollatorStatus::Active.

Returns Some(is_active) if the account is a candidate, else None.

source

pub fn selected_candidates() -> BoundedVec<T::AccountId, T::MaxTopCandidates>

Return the best MaxSelectedCandidates many candidates.

In case a collator from last round was replaced by a candidate with the same total stake during sorting, we revert this swap to prioritize collators over candidates.

source§

impl<T: Config> Pallet<T>

source

pub fn max_selected_candidates() -> u32

An auto-generated getter for MaxSelectedCandidates.

source§

impl<T: Config> Pallet<T>

source

pub fn round() -> RoundInfo<BlockNumberFor<T>>

An auto-generated getter for Round.

source§

impl<T: Config> Pallet<T>

source

pub fn last_delegation<KArg>(k: KArg) -> DelegationCounterwhere KArg: EncodeLike<T::AccountId>,

An auto-generated getter for LastDelegation.

source§

impl<T: Config> Pallet<T>

source

pub fn delegator_state<KArg>( k: KArg ) -> Option<Stake<T::AccountId, <<T as Config>::Currency as Inspect<<T as Config>::AccountId>>::Balance>>where KArg: EncodeLike<T::AccountId>,

An auto-generated getter for DelegatorState.

source§

impl<T: Config> Pallet<T>

source

pub fn candidate_pool<KArg>( k: KArg ) -> Option<Candidate<T::AccountId, <<T as Config>::Currency as Inspect<<T as Config>::AccountId>>::Balance, T::MaxDelegatorsPerCollator>>where KArg: EncodeLike<T::AccountId>,

An auto-generated getter for CandidatePool.

source§

impl<T: Config> Pallet<T>

source

pub fn total_collator_stake( ) -> TotalStake<<<T as Config>::Currency as Inspect<<T as Config>::AccountId>>::Balance>

An auto-generated getter for TotalCollatorStake.

source§

impl<T: Config> Pallet<T>

source

pub fn top_candidates( ) -> OrderedSet<Stake<T::AccountId, <<T as Config>::Currency as Inspect<<T as Config>::AccountId>>::Balance>, T::MaxTopCandidates>

An auto-generated getter for TopCandidates.

source§

impl<T: Config> Pallet<T>

source

pub fn inflation_config() -> InflationInfo

An auto-generated getter for InflationConfig.

source§

impl<T: Config> Pallet<T>

source

pub fn unstaking<KArg>( k: KArg ) -> BoundedBTreeMap<BlockNumberFor<T>, <<T as Config>::Currency as Inspect<<T as Config>::AccountId>>::Balance, T::MaxUnstakeRequests>where KArg: EncodeLike<T::AccountId>,

An auto-generated getter for Unstaking.

source§

impl<T: Config> Pallet<T>

source

pub fn max_candidate_stake( ) -> <<T as Config>::Currency as Inspect<<T as Config>::AccountId>>::Balance

An auto-generated getter for MaxCollatorCandidateStake.

source§

impl<T: Config> Pallet<T>

source

pub fn last_reward_reduction() -> BlockNumberFor<T>

An auto-generated getter for LastRewardReduction.

source§

impl<T: Config> Pallet<T>

source

pub fn blocks_authored<KArg>(k: KArg) -> BlockNumberFor<T>where KArg: EncodeLike<T::AccountId>,

An auto-generated getter for BlocksAuthored.

source§

impl<T: Config> Pallet<T>

source

pub fn blocks_rewarded<KArg>(k: KArg) -> BlockNumberFor<T>where KArg: EncodeLike<T::AccountId>,

An auto-generated getter for BlocksRewarded.

source§

impl<T: Config> Pallet<T>

source

pub fn rewards<KArg>( k: KArg ) -> <<T as Config>::Currency as Inspect<<T as Config>::AccountId>>::Balancewhere KArg: EncodeLike<T::AccountId>,

An auto-generated getter for Rewards.

source§

impl<T: Config> Pallet<T>

source

pub fn new_round_forced() -> bool

An auto-generated getter for ForceNewRound.

Trait Implementations§

source§

impl<T: Config> BeforeAllRuntimeMigrations for Pallet<T>

source§

fn before_all_runtime_migrations() -> Weight

Something that should happen before runtime migrations are executed.
source§

impl<T> Benchmarking for Pallet<T>where T: Config + Config, u64: Into<BlockNumberFor<T>>, <T as Config>::Currency: Mutate<T::AccountId>,

source§

fn benchmarks(extra: bool) -> Vec<BenchmarkMetadata>

Get the benchmarks available for this pallet. Generally there is one benchmark per extrinsic, so these are sometimes just called “extrinsics”. Read more
source§

fn run_benchmark( extrinsic: &[u8], c: &[(BenchmarkParameter, u32)], whitelist: &[TrackedStorageKey], verify: bool, internal_repeats: u32 ) -> Result<Vec<BenchmarkResult>, BenchmarkError>

Run the benchmarks for this pallet.
source§

impl<T: Config> Callable<T> for Pallet<T>

source§

impl<T> Clone for Pallet<T>

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T> Debug for Pallet<T>

source§

fn fmt(&self, fmt: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T: Config> EstimateNextSessionRotation<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>

source§

fn average_session_length() -> BlockNumberFor<T>

Return the average length of a session. Read more
source§

fn estimate_current_session_progress( now: BlockNumberFor<T> ) -> (Option<Permill>, Weight)

Return an estimate of the current session progress. Read more
source§

fn estimate_next_session_rotation( _now: BlockNumberFor<T> ) -> (Option<BlockNumberFor<T>>, Weight)

Return the block number at which the next session rotation is estimated to happen. Read more
source§

impl<T> EventHandler<<T as Config>::AccountId, <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where T: Config + Config + Config,

source§

fn note_author(author: T::AccountId)

Increments the reward counter of the block author by the current number of collators in the session.

source§

impl<T: Config> GetStorageVersion for Pallet<T>

§

type CurrentStorageVersion = StorageVersion

This will be filled out by the pallet macro. Read more
source§

fn current_storage_version() -> Self::CurrentStorageVersion

Returns the current storage version as supported by the pallet.
source§

fn on_chain_storage_version() -> StorageVersion

Returns the on-chain storage version of the pallet as stored in the storage.
source§

impl<T: Config> Hooks<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>

source§

fn on_initialize(now: BlockNumberFor<T>) -> Weight

Block initialization hook. This is called at the very beginning of block execution. Read more
source§

fn try_state(_n: BlockNumberFor<T>) -> Result<(), TryRuntimeError>

Execute the sanity checks of this pallet, per block. Read more
§

fn on_finalize(_n: BlockNumber)

Block finalization hook. This is called at the very end of block execution. Read more
§

fn on_idle(_n: BlockNumber, _remaining_weight: Weight) -> Weight

Hook to consume a block’s idle time. This will run when the block is being finalized (before [Hooks::on_finalize]). Read more
§

fn on_runtime_upgrade() -> Weight

Hook executed when a code change (aka. a “runtime upgrade”) is detected by FRAME. Read more
§

fn pre_upgrade() -> Result<Vec<u8, Global>, DispatchError>

Execute some pre-checks prior to a runtime upgrade. Read more
§

fn post_upgrade(_state: Vec<u8, Global>) -> Result<(), DispatchError>

Execute some post-checks after a runtime upgrade. Read more
§

fn offchain_worker(_n: BlockNumber)

Implementing this function on a pallet allows you to perform long-running tasks that are dispatched as separate threads, and entirely independent of the main wasm runtime. Read more
§

fn integrity_test()

Check the integrity of this pallet’s configuration. Read more
source§

impl<T: Config> IntegrityTest for Pallet<T>

source§

fn integrity_test()

See [Hooks::integrity_test].
source§

impl<T: Config> OffchainWorker<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>

source§

fn offchain_worker(n: BlockNumberFor<T>)

This function is being called after every block import (when fully synced). Read more
source§

impl<T: Config> OnFinalize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>

source§

fn on_finalize(n: BlockNumberFor<T>)

See [Hooks::on_finalize].
source§

impl<T: Config> OnGenesis for Pallet<T>

source§

fn on_genesis()

Something that should happen at genesis.
source§

impl<T: Config> OnIdle<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>

source§

fn on_idle(n: BlockNumberFor<T>, remaining_weight: Weight) -> Weight

See [Hooks::on_idle].
source§

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

See [Hooks::on_initialize].
source§

impl<T: Config> OnRuntimeUpgrade for Pallet<T>

source§

fn on_runtime_upgrade() -> Weight

See [Hooks::on_runtime_upgrade].
source§

fn pre_upgrade() -> Result<Vec<u8>, TryRuntimeError>

See [Hooks::pre_upgrade].
source§

fn post_upgrade(state: Vec<u8>) -> Result<(), TryRuntimeError>

See [Hooks::post_upgrade].
§

fn try_on_runtime_upgrade(checks: bool) -> Result<Weight, DispatchError>

The expected and default behavior of this method is to handle executing pre_upgrade -> on_runtime_upgrade -> post_upgrade hooks for a migration. Read more
source§

impl<T: Config> PalletInfoAccess for Pallet<T>

source§

fn index() -> usize

Index of the pallet as configured in the runtime.
source§

fn name() -> &'static str

Name of the pallet as configured in the runtime.
source§

fn name_hash() -> [u8; 16]

Two128 hash of name.
source§

fn module_name() -> &'static str

Name of the Rust module containing the pallet.
source§

fn crate_version() -> CrateVersion

Version of the crate containing the pallet.
source§

impl<T: Config> PalletsInfoAccess for Pallet<T>

source§

fn count() -> usize

The number of pallets’ information that this type represents. Read more
source§

fn infos() -> Vec<PalletInfoData>

All of the pallets’ information that this type represents.
source§

impl<T> PartialEq<Pallet<T>> for Pallet<T>

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T: Config> SessionManager<<T as Config>::AccountId> for Pallet<T>

source§

fn new_session(new_index: SessionIndex) -> Option<Vec<T::AccountId>>

  1. A new session starts.
  2. In hook new_session: Read the current top n candidates from the TopCandidates and assign this set to author blocks for the next session.
  3. AuRa queries the authorities from the session pallet for this session and picks authors on round-robin-basis from list of authorities.
source§

fn end_session(_end_index: SessionIndex)

End the session. Read more
source§

fn start_session(_start_index: SessionIndex)

Start an already planned session. Read more
§

fn new_session_genesis(new_index: u32) -> Option<Vec<ValidatorId, Global>>

Same as new_session, but it this should only be called at genesis. Read more
source§

impl<T: Config> ShouldEndSession<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>

source§

fn should_end_session(now: BlockNumberFor<T>) -> bool

Return true if the session should be ended.
source§

impl<T: Config> StorageInfoTrait for Pallet<T>

source§

fn storage_info() -> Vec<StorageInfo>

source§

impl<T: Config> TryDecodeEntireStorage for Pallet<T>

source§

fn try_decode_entire_state() -> Result<usize, Vec<TryDecodeEntireStorageError>>

Decode the entire data under the given storage, returning Ok(bytes_decoded) if success.
source§

impl<T: Config> TryState<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>

source§

fn try_state( n: BlockNumberFor<T>, _s: TryStateSelect ) -> Result<(), TryRuntimeError>

Execute the state checks.
source§

impl<T: Config> WhitelistedStorageKeys for Pallet<T>

source§

fn whitelisted_storage_keys() -> Vec<TrackedStorageKey>

Returns a 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.
source§

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§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<S> CallSources<S, S> for Swhere S: Clone,

§

fn sender(&self) -> S

The sender of the call who will pay for all deposits and fees.
§

fn subject(&self) -> S

The subject of the call.
§

impl<T> CheckedConversion for T

§

fn checked_from<T>(t: T) -> Option<Self>where Self: TryFrom<T>,

Convert from a value of T into an equivalent instance of Option<Self>. Read more
§

fn checked_into<T>(self) -> Option<T>where Self: TryInto<T>,

Consume self to return Some equivalent value of Option<T>. Read more
§

impl<T> Conv for T

§

fn conv<T>(self) -> Twhere Self: Into<T>,

Converts self into T using Into<T>. Read more
source§

impl<T> DynClone for Twhere T: Clone,

source§

fn __clone_box(&self, _: Private) -> *mut ()

source§

impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
§

impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<T> FmtForward for T

§

fn fmt_binary(self) -> FmtBinary<Self>where Self: Binary,

Causes self to use its Binary implementation when Debug-formatted.
§

fn fmt_display(self) -> FmtDisplay<Self>where Self: Display,

Causes self to use its Display implementation when Debug-formatted.
§

fn fmt_lower_exp(self) -> FmtLowerExp<Self>where Self: LowerExp,

Causes self to use its LowerExp implementation when Debug-formatted.
§

fn fmt_lower_hex(self) -> FmtLowerHex<Self>where Self: LowerHex,

Causes self to use its LowerHex implementation when Debug-formatted.
§

fn fmt_octal(self) -> FmtOctal<Self>where Self: Octal,

Causes self to use its Octal implementation when Debug-formatted.
§

fn fmt_pointer(self) -> FmtPointer<Self>where Self: Pointer,

Causes self to use its Pointer implementation when Debug-formatted.
§

fn fmt_upper_exp(self) -> FmtUpperExp<Self>where Self: UpperExp,

Causes self to use its UpperExp implementation when Debug-formatted.
§

fn fmt_upper_hex(self) -> FmtUpperHex<Self>where Self: UpperHex,

Causes self to use its UpperHex implementation when Debug-formatted.
§

fn fmt_list(self) -> FmtList<Self>where &'a Self: for<'a> IntoIterator,

Formats each item in a sequence. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where F: FnOnce(&Self) -> bool,

Converts 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<T> IsType<T> for T

§

fn from_ref(t: &T) -> &T

Cast reference.
§

fn into_ref(&self) -> &T

Cast reference.
§

fn from_mut(t: &mut T) -> &mut T

Cast mutable reference.
§

fn into_mut(&mut self) -> &mut T

Cast mutable reference.
§

impl<T, Outer> IsWrappedBy<Outer> for Twhere Outer: AsRef<T> + AsMut<T> + From<T>, T: From<Outer>,

§

fn from_ref(outer: &Outer) -> &T

Get a reference to the inner from the outer.

§

fn from_mut(outer: &mut Outer) -> &mut T

Get a mutable reference to the inner from the outer.

§

impl<T> Pipe for Twhere T: ?Sized,

§

fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere Self: Sized,

Pipes by value. This is generally the method you want to use. Read more
§

fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere R: 'a,

Borrows 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,

Mutably borrows 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,

Borrows self, then passes self.borrow() into the pipe function. Read more
§

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,

Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more
§

fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> Rwhere Self: AsRef<U>, U: 'a + ?Sized, R: 'a,

Borrows 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,

Mutably borrows self, then passes self.as_mut() into the pipe function.
§

fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> Rwhere Self: Deref<Target = T>, T: 'a + ?Sized, R: 'a,

Borrows self, then passes self.deref() into the pipe function.
§

fn pipe_deref_mut<'a, T, R>( &'a mut self, func: impl FnOnce(&'a mut T) -> R ) -> Rwhere Self: DerefMut<Target = T> + Deref, T: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.deref_mut() into the pipe function.
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
§

impl<T> SaturatedConversion for T

§

fn saturated_from<T>(t: T) -> Selfwhere Self: UniqueSaturatedFrom<T>,

Convert from a value of T into an equivalent instance of Self. Read more
§

fn saturated_into<T>(self) -> Twhere Self: UniqueSaturatedInto<T>,

Consume self to return an equivalent value of T. Read more
§

impl<SS, SP> SupersetOf<SS> for SPwhere SS: SubsetOf<SP>,

§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
§

impl<T> Tap for T

§

fn tap(self, func: impl FnOnce(&Self)) -> Self

Immutable access to a value. Read more
§

fn tap_mut(self, func: impl FnOnce(&mut Self)) -> Self

Mutable access to a value. Read more
§

fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Selfwhere Self: Borrow<B>, B: ?Sized,

Immutable access to the Borrow<B> of a value. Read more
§

fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere Self: BorrowMut<B>, B: ?Sized,

Mutable access to the BorrowMut<B> of a value. Read more
§

fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Selfwhere Self: AsRef<R>, R: ?Sized,

Immutable access to the 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,

Mutable access to the AsMut<R> view of a value. Read more
§

fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Selfwhere Self: Deref<Target = T>, T: ?Sized,

Immutable access to the 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,

Mutable access to the Deref::Target of a value. Read more
§

fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self

Calls .tap() only in debug builds, and is erased in release builds.
§

fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self

Calls .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,

Calls .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,

Calls .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,

Calls .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,

Calls .tap_ref_mut() only in debug builds, and is erased in release builds.
§

fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Selfwhere Self: Deref<Target = T>, T: ?Sized,

Calls .tap_deref() only in debug builds, and is erased in release builds.
§

fn tap_deref_mut_dbg<T>(self, func: impl FnOnce(&mut T)) -> Selfwhere Self: DerefMut<Target = T> + Deref, T: ?Sized,

Calls .tap_deref_mut() only in debug builds, and is erased in release builds.
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
§

impl<T> TryConv for T

§

fn try_conv<T>(self) -> Result<T, Self::Error>where Self: TryInto<T>,

Attempts to convert self into T using TryInto<T>. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<S, T> UncheckedInto<T> for Swhere T: UncheckedFrom<S>,

§

fn unchecked_into(self) -> T

The counterpart to unchecked_from.
§

impl<T, S> UniqueSaturatedInto<T> for Swhere T: Bounded, S: TryInto<T>,

§

fn unique_saturated_into(self) -> T

Consume self to return an equivalent value of T.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<T> JsonSchemaMaybe for T

§

impl<T> MaybeDebug for Twhere T: Debug,

§

impl<T> MaybeRefUnwindSafe for Twhere T: RefUnwindSafe,

§

impl<T> Member for Twhere T: Send + Sync + Debug + Eq + PartialEq<T> + Clone + 'static,

source§

impl<T> Scalar for Twhere T: 'static + Clone + PartialEq<T> + Debug,