Struct Pallet

Source
pub struct Pallet<T>(PhantomData<T>);
Expand description

Primary Marker type for the Authors pallet.

This pallet provides implementations for traits from roles and elections

Pallet implements the core role-system traits:

and pluggable election runner traits

Tuple Fields§

§0: PhantomData<T>

Implementations§

Source§

impl<T: Config> Pallet<T>

Source

pub fn enlist( origin: OriginFor<T>, collateral: AuthorAsset<T>, fortitude: FortitudeWrapper, ) -> DispatchResult

Enlist the caller as an author by locking the required collateral.

Establishes the caller as an author by placing collateral under the author role commitment.

§Requirements
  • Provided collateral must be at least MinCollateral.
  • Fails if the caller is already enrolled as an author.
§Behavior
  • Locks the required collateral and associates it with the author role.
  • Ensures at least the minimum collateral is maintained.
§Execution Controls

Emits: Event::AuthorEnlisted

Source

pub fn back( origin: OriginFor<T>, via: FundingTarget<T>, value: AuthorAsset<T>, fortitude: FortitudeWrapper, precision: PrecisionWrapper, ) -> DispatchResult

Provide economic backing support to an author using a supported funding model.

This extrinsic allows the caller to economically support an author by locking assets under the FreezeReason::AuthorFunding commitment domain. Funding directly affects an author’s eligibility, exposure, and election weight.

§Funding Models
  • Direct: Funds are committed explicitly to a single author.
  • Index: Route funds through an index resolving to multiple author digests.
  • Pool: Commit funds to a managed pool of authors with commission-based withdrawals.
§Guarantees
  • Funds are fully locked and cannot be double-used elsewhere.
  • Author collateral is never mixed with external funding.
  • MinFund and MaxExposure are strictly enforced.
  • Local minimum and maximum limits enforced by authors and underlying systems are considered.
  • Funding is rejected if the resolved author or digest is invalid.
§Execution Controls
  • precision defines how strictly the requested amount must be satisfied:
    • [Precision::Exact]: Requires full amount commitment.
    • [Precision::BestEffort]: Allows partial fulfillment where supported.
  • force defines how funds are sourced:
    • [Fortitude::Force]: Uses the caller’s liquid balance, enforcing the commitment directly.
    • [Fortitude::Polite]: Uses funds already deposited in the commitment reserve (if Config::CommitmentAdapter == pallet_commitment).

Emits via internal hook: - Event::AuthorFunded if direct author backing - Event::IndexFunded multiple authors via an index - Event::PoolFunded multiple authors via a managed pool

Source

pub fn refill( origin: OriginFor<T>, collateral: AuthorAsset<T>, fortitude: FortitudeWrapper, ) -> DispatchResult

Increase the caller’s collateral by locking additional assets.

Adds to the existing collateral, strengthening the author’s position and ensuring compliance with evolving system requirements such as MinCollateral.

§Behavior
  • Collateral is added on top of existing locked collateral.
§Execution Controls

Emits: Event::AuthorCollateralRaised

Source

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

Confirm the caller as an active author after completing probation.

Transitions the author from probation to active status once all probation conditions are satisfied.

§Requirements
  • Caller must be under probation.
  • Probation conditions must be fulfilled.
§Notes
  • Authors are responsible for completing their probation requirements.
  • Activation enables full participation in author duties.

Emits: Event::AuthorStatus via internal hook

Source

pub fn exit(origin: OriginFor<T>, from: FundingTarget<T>) -> DispatchResult

Exit an existing backing position towards an author.

Releases the caller’s committed funds (including any applicable rewards or penalties) from a direct, index, or pool-based backing, once the position is eligible for exit.

§Behavior
  • Exits only the caller’s backing position.
  • Author collateral remains unaffected.
  • Other backers’ commitments remain intact.
§Validation
  • Ensures the backing position exists and is withdrawable.
  • Resolves the target author from index or pool digests.

Emits:

Source

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

Resign from the author role and exit active participation.

Releases the caller’s collateral while retaining any external backing relationships until funders explicitly exit their positions.

§Behavior
  • Removes the caller from active author participation.
  • Releases all locked collateral back to the caller.
  • External funders/backers must withdraw separately via Pallet::exit.
  • The author’s digest is reaped only if no active backing remains.

Emits: Event::AuthorResigned

Source

pub fn create_index( origin: OriginFor<T>, entries: Vec<(Author<T>, Shares<T>)>, ) -> DispatchResult

Create a new funding index over a set of authors.

An index represents a weighted collection of author commitment digests, enabling aggregated funding and proportional exposure.

  • Index entries resolve exclusively to author collateral digests.
  • Share weights are deterministic and auditable.
  • The caller becomes the index owner.

Emits: Event::IndexCreated via deposit event

Source

pub fn create_pool( origin: OriginFor<T>, index: IndexDigest<T>, commission: Commission<T>, ) -> DispatchResult

Create a new funding pool backed by an existing index.

Pools enable managed aggregation of funds with an explicit commission applied to rewards earned via the underlying index.

  • Pool configuration is uniquely identified by its digest.
  • Commission is fixed at creation time, changing commission after creates a new pool with same slots and updated commission.
  • The caller becomes the initial pool manager.

Emits: Event::PoolCreated via deposit event

Source

pub fn transfer_pool( origin: OriginFor<T>, pool: PoolDigest<T>, to: T::AccountId, ) -> DispatchResult

Transfer management ownership of a funding pool.

Updates the pool manager without affecting custody of funds. The pool remains non-custodial, and all underlying funds, slots, and backing relationships remain unchanged.

§Requirements
  • Callable only by the current pool manager.
§Behavior
  • Transfers only management control.
  • Does not transfer ownership of any pooled funds.

Emits: Event::PoolManager

Source

pub fn update_commission( origin: OriginFor<T>, index: IndexDigest<T>, commission: Commission<T>, ) -> DispatchResult

Update the commission for a funding pool by creating a new pool instance.

This operation does not mutate the existing pool. Instead, it creates a new pool derived from the given index with the updated commission, assigning the caller as the new pool manager.

§Behavior
  • A new pool is created with the specified commission.
  • The caller becomes the manager of the new pool.
  • The new pool starts with no funds or backing.
  • The original pool remains unchanged.
§Notes
  • Pools are non-custodial, and funds are not transferred during this operation.
  • This effectively creates a fresh pool configuration with updated parameters.

Emits: Event::PoolCreated

Source

pub fn update_entry_shares( origin: OriginFor<T>, index: IndexDigest<T>, entry: IndexDigest<T>, shares: Shares<T>, ) -> DispatchResult

Derive a new index with updated share weight for a specific entry.

This operation does not mutate the existing index. Instead, it creates a new index configuration where the specified entry is assigned the given shares, while all other entries remain unchanged.

§Behavior
  • Produces a new index digest reflecting the updated share distribution.
  • The original index remains immutable and unchanged.
§Notes
  • Indexes are immutable once created.
  • Any modification to entry shares results in a new index instance.

Emits: Event::IndexCreated

Source

pub fn update_slot_shares( origin: OriginFor<T>, pool: PoolDigest<T>, slot: PoolDigest<T>, shares: Shares<T>, ) -> DispatchResult

Update the share weight of a slot within an existing pool.

Modifies the share allocation of the specified slot in the given pool without altering the pool’s identity or existing commitments.

§Requirements
  • Caller must be the current pool manager.
  • The specified pool and slot must be valid.
§Behavior
  • Updates the slot’s share weight in place.
  • Preserves all existing funds, commitments, and pool configuration.
§Notes
  • Unlike indexes, pools are mutable and support in-place updates.

Emits: Event::PoolSlotShare

Source

pub fn force_genesis_config( origin: OriginFor<T>, field: ForceGenesisConfig<T>, ) -> DispatchResult

Force-update a selected genesis configuration parameter.

Origin: Root only.

This extrinsic allows privileged modification of runtime parameters that were originally defined at genesis.

  • ProbationPeriod - Updates the number of blocks authors must remain in probation.
  • ReduceProbationBy - Updates how much probation is reduced on good behavior.
  • IncreaseProbationBy - Updates how much probation is increased on misbehavior.
  • RewardsBuffer - Updates the delay (in blocks) before rewards are finalized.
  • PenaltiesBuffer - Updates the delay (in blocks) before penalties are enforced.
  • MaxElected - Updates the maximum number of authors that can be elected.
  • MinElected - Updates the minimum number of authors required for a valid election.
  • EnforceMaxElected - Toggles strict enforcement of the MaxElected limit.
  • MinFund - Updates the minimum funding required per backing operation.
  • MaxExposure - Updates the maximum allowed exposure per funding operation.
  • MinCollateral - Updates the minimum collateral required for authors.

The call enforces consistency constraints where applicable:

This call directly overwrites storage and emits an event containing the updated configuration variant.

Source§

impl<T: Config> Pallet<T>

Public read-only functions for inspecting author collateral and funding state.

This interface exposes non-mutating functions that allow external consumers (e.g. off-chain clients, RPC layers, and other pallets) to inspect the economic state of authors and funding relationships.

Source

pub fn fetch_collateral(who: Author<T>) -> Result<AuthorAsset<T>, DispatchError>

Return the total locked collateral of an author.

  • who must be an enrolled author.
Source

pub fn inspect_fund( caller: T::AccountId, from: FundingTarget<T>, ) -> Result<AuthorAsset<T>, DispatchError>

Fetch the caller’s total committed funding under a specific funding model.

  • The caller must have an active commitment under the specified target.
  • The provided digest must match the caller’s active commitment.
Source

pub fn inspect_author_fund( caller: T::AccountId, author: Author<T>, from: FundingTarget<T>, ) -> Result<AuthorAsset<T>, DispatchError>

Fetch the caller’s committed funding towards a specific author.

  • The caller must have an active funding relationship with the author under the specified funding target.
Source§

impl<T: Config> Pallet<T>

Source

pub(crate) fn deposit_event(event: Event<T>)

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: Config> Callable<T> for Pallet<T>

Source§

impl<T> Clone for Pallet<T>

Source§

fn clone(&self) -> Self

Returns a duplicate 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: Config> CompensateRoles<<T as Config>::AccountId> for Pallet<T>

Implements the CompensateRoles trait for the Author subsystem

Defines how authors can be rewarded/slashed along with its backers within the runtime.

Source§

type Ratio = Perbill

The penalty ratio type.

Uses [Perbill], a fixed-point representation with 1 billion precision.

§Example
  • Perbill::from_percent(5) -> 5% penalty
  • Perbill::from_parts(500_000_000) -> 50% penalty
Source§

fn has_reward(who: &Author<T>) -> DispatchResult

Checks whether the given Author currently has any pending rewards.

  • This function only performs a read check - it does not mutate state.
  • The lookup range ensures that pending rewards are checked from the next block onward, accounting for rewards that may already be queued but not yet enforced.

DispatchError otherwise.

Source§

fn has_penalty(who: &Author<T>) -> DispatchResult

Checks whether the given Author currently has any pending penalties.

  • This function only performs a read check - it does not mutate state.
  • The lookup range ensures that pending penalties are checked from the next block onward, accounting for penalries that may already be queued but not yet enforced.

DispatchError otherwise.

Source§

fn get_rewards_of( who: &Author<T>, ) -> Result<Vec<(Self::TimeStamp, Self::Asset)>, DispatchError>

Retrieves all pending rewards for a given author.

Rewards are finalized over time via periodic enforcement, so the current block is skipped since it would have been finalized

§Returns
  • Ok(Vec<(TimeStamp, Asset)>) - a list of (block_number, reward_value) tuples for each reward found.
  • Err(DispatchError) - otherwise.
Source§

fn get_penalties_of( who: &Author<T>, ) -> Result<Vec<(Self::TimeStamp, Self::Ratio)>, DispatchError>

Retrieves all pending penalities for a given author.

Penalties are finalized over time via periodic enforcement, so the current block is skipped since it would have been finalized

§Returns
  • Ok(Vec<(TimeStamp, Ratio)>) - a list of (block_number, factor) tuples for each penalty found.
  • Err(DispatchError) - otherwise.
Source§

fn get_hold(who: &Author<T>) -> Result<Self::Asset, DispatchError>

Retrieves the current hold amount for the specified Author.

  • This function is read-only and does not modify any runtime state.
  • The returned hold includes all live reserved assets for the author: funding, collateral, and enforced rewards/penalties.

DispatchError otherwise

Source§

fn get_rewards_on( time_stamp: Self::TimeStamp, ) -> Result<Vec<(Author<T>, Self::Asset)>, DispatchError>

Retrieves all pending rewards for a specific timestamp across all authors.

This function performs a reverse lookup of rewards scheduled for enforcement at the given time_stamp.

Rewards at or before the current finalized block cannot be queried, as they are already settled and no longer represent pending obligations.

§Returns
  • Ok(Vec<(Author<T>, Asset)>) - a list of (author, reward_value) tuples representing pending rewards for the specified timestamp.
  • Err(DispatchError) otherwise.
Source§

fn get_penalties_on( time_stamp: Self::TimeStamp, ) -> Result<Vec<(Author<T>, Self::Ratio)>, DispatchError>

Retrieves all pending penalties for a specific timestamp across all authors.

This function performs a reverse lookup of penalties scheduled for enforcement at the given time_stamp.

Penalties at or before the current finalized block cannot be queried, as they are already settled and no longer represent pending obligations.

§Returns
  • Ok(Vec<(Author<T>, Ratio)>) - a list of (author, factor) tuples representing pending penalties for the specified timestamp.
  • Err(DispatchError) otherwise.
Source§

fn set_hold( who: &Author<T>, value: Self::Asset, precision: Precision, force: Fortitude, ) -> DispatchResult

Updates the total hold amount of an author by proportionally redistributing the specified value across all of its components.

  • A hold represents an aggregated value of all live reserved assets for the author: funding, collateral, and enforced rewards/penalties.

This function recalculates and updates these underlying components based on the new total hold value provided.

§Returns
  • Ok(()) - if the total hold was successfully recalculated and updated.
  • Err(DispatchError) - otherwise.
Source§

fn penalize( who: &Author<T>, factor: Self::Ratio, ) -> Result<Self::TimeStamp, DispatchError>

Applies a penalty to a given author, scheduled for enforcement at a future block.

A penalty represents a negative adjustment to the author’s hold.

This function registers a proportional penalty (as a [PerThing] factor) against all of author’s commitments.

Each penalty is deferred for a specified buffer period to allow orderly finalization and to ensure temporal separation of distinct penalty events.

Applies risk to the author’s permanence before applying the penalty.

Additionally tries to revoke permanence for permenant authors if possible.

§Returns
  • Ok(TimeStamp) - the block number at which the penalty is scheduled to finalize.
  • Err(DispatchError) - otherwise.
Source§

fn forgive( who: &Author<T>, from: Self::TimeStamp, ) -> Result<Self::Ratio, DispatchError>

Removes a pending penalty for a given author, effectively forgiving it at a particular timestamp.

It allows the system to revoke a scheduled penalty that has not yet been finalized, identified by the specific timestamp (from) at which the penalty was originally set for enforcement.

  • Forgiveness cannot apply to penalties at or before the finalized block height.
  • Author permanence is re-secured upon successful forgiveness.
§Returns
  • Ok(Ratio) - the penalty factor that was successfully forgiven.
  • Err(DispatchError) - otherwise
Source§

fn reward( who: &Author<T>, value: Self::Asset, _precision: Precision, ) -> Result<Self::TimeStamp, DispatchError>

Schedules a reward for a given author at a future block.

A reward represents a positive adjustment to the author’s hold.

Each reward is deferred for a specified buffer period to allow orderly finalization and to ensure temporal separation of distinct penalty events.

Ensures the author’s permanence is secured before applying the reward.

§Returns
  • Ok(TimeStamp) - the block number at which the reward is scheduled.
  • Err(DispatchError) - otherwise.
  • Ok(TimeStamp) - the block number at which the reward is scheduled.
  • Err(DispatchError) - otherwise.
Source§

fn reclaim( who: &Author<T>, from: Self::TimeStamp, ) -> Result<Self::Asset, DispatchError>

Removes a pending reward for a given author, effectively regaining it from a particular timestamp scheduled.

It allows the system to revoke a scheduled reward that has not yet been finalized, identified by the specific timestamp (from) at which the reward was originally set for enforcement.

Regaining cannot apply to rewards at or before the finalized block height.

§Returns
  • Ok(Asset) - the total reward that was successfully regained.
  • Err(DispatchError) - otherwise
Source§

fn on_reward(who: &Author<T>, amount: Self::Asset, at: Self::TimeStamp)

Hook invoked when reward is scheduled or applied to an author.

Emits Event::AuthorRewardScheduled if Config::EmitEvents is true.

Source§

fn on_reclaim(who: &Author<T>, amount: Self::Asset)

Hook invoked when an author’s scheduled rewards are reclaimed.

Emits Event::AuthorRewardReclaimed if Config::EmitEvents is true.

Source§

fn on_set_hold(who: &Author<T>, value: Self::Asset)

Hook invoked when an author’s hold balance is updated.

Emits Event::AuthorTotalHold if Config::EmitEvents is true.

Source§

fn on_forgive(who: &Author<T>, factor: Self::Ratio)

Hook invoked when an author’s scheduled penalty is forgiven.

Emits Event::AuthorPenaltyForgiven if Config::EmitEvents is true.

Source§

fn on_penalize(who: &Author<T>, factor: Self::Ratio, at: Self::TimeStamp)

Hook invoked when penality is scheduled or applied to an author.

Emits Event::AuthorPenaltyScheduled if Config::EmitEvents is true.

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> DispatchViewFunction for Pallet<T>

Source§

fn dispatch_view_function<O: Output>( id: &ViewFunctionId, input: &mut &[u8], output: &mut O, ) -> Result<(), ViewFunctionDispatchError>

Source§

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

Implements the FundRoles trait for the Author subsystem

Defines how authors can be externally backed by external collaterals within the runtime.

Source§

type Backer = Funder<T>

Represents the entity providing funding to an author.

Can be a direct account, an index, or a managed pool.

Indirect backers such as index or pools must have a direct account willing to back (fund) it.

Source§

fn has_funds(who: &Author<T>) -> DispatchResult

Checks if the author has any active backers/funds.

Returns a DispatchError if no funders exist.

Source§

fn max_exposure( by: &Self::Backer, to: &Author<T>, precision: Precision, force: Fortitude, ) -> Result<Self::Asset, DispatchError>

Returns the maximum exposure allowed for an Author from a Backer, under the directive of the attempted funding.

For Funder::Direct backers, limits are derived from:

  • global constraint (MaxExposure),
  • author-specific constraint (AuthorInfo’s max_fund),
  • and underlying commitment limits via CommitmentAdapter, depending on whether the fund is new or being raised.

For index and pool funders:

  • only global and author-specific constraints are applied.

The precision and force parameters simulate the directive of the funding attempt.

Source§

fn min_fund( by: &Self::Backer, to: &Author<T>, precision: Precision, force: Fortitude, ) -> Result<Self::Asset, DispatchError>

Returns the minimum funding amount required for a Backer to fund an Author, under the directive of the attempted funding.

For Funder::Direct backers, limits are derived from:

  • global constraint (MinFund),
  • author-specific constraint (AuthorInfo’s min_fund),
  • and underlying commitment limits via CommitmentAdapter, depending on whether the fund is new or being raised.

For index and pool funders:

  • only global and author-specific constraints are applied.

The precision and force parameters simulate the directive of the funding attempt.

Source§

fn backed_value(who: &Author<T>) -> Result<Self::Asset, DispatchError>

Total real-time funds currently backing the author (excluding the author’s own collateral).

Only includes finalized commitments; pending rewards or penalties are ignored.

Source§

fn total_backing() -> Self::Asset

Total real-time funds currently backing all the authors (excluding all authors own collaterals).

Only includes finalized commitments; pending rewards or penalties are ignored.

Source§

fn can_fund( by: &Self::Backer, to: &Author<T>, value: Self::Asset, precision: Precision, force: Fortitude, ) -> DispatchResult

Validates whether a backer can fund a given author.

Returns Ok(()) if the backer is eligible to fund, or a DispatchError otherwise.

Source§

fn fund( to: &Author<T>, by: &Self::Backer, value: Self::Asset, precision: Precision, force: Fortitude, ) -> Result<Self::Asset, DispatchError>

Funds an author on behalf of a backer.

This function either places a new fund for an author or increases an existing fund if the author has already been funded by the same backer.

The backer Self::Backer is of type Funder in itself explains to whom its funding, and via what.

This function asks a suitable author to diligently even for index and pool backers. It is never unused as we can do additional invariant checks.

Hence indexes and pool backers should ensure that the author given is indeed true in its context of valdidation i.e., author available in respective entires or slots.

In case of backers being index or pools, the returned amount reflects the total funding to it (may not be only for the given author)

§Returns
  • Ok(Asset): The amount successfully funded.
  • Err(DispatchError) otherwise.
Source§

fn can_draw(by: &Self::Backer, from: &Author<T>) -> DispatchResult

Validates whether a backer can withdraw their existing fund from a given author.

The backer Self::Backer is of type Funder in itself explains to whom its funded, and via what.

This function asks a suitable author from diligently even for index and pool backers. It is never unused as we can do additional invariant checks.

Hence indexes and pool backers should ensure that the author given is indeed true in its context of valdidation i.e., author available in respective entires or slots.

Returns Ok(()) if the backer is eligible to withdraw the fund, or a DispatchError otherwise.

Source§

fn draw( from: &Author<T>, by: &Self::Backer, ) -> Result<Self::Asset, DispatchError>

Withdraws funds for a given author on behalf of a backer.

This function allows a backer to “draw” or withdraw funds that were committed to an author. Depending on the type of backer, the withdrawal behaves slightly differently:

  • Direct Backer: Withdraws the funds directly committed by the backer.
  • Index Backer: Withdraws the total funds of the specified index, assuming the author is part of it.
  • Pool Backer: Withdraws the total funds of the pool, assuming the author is part of it.

Returns the withdrawn amount on success, or a DispatchError if validation fails.

Source§

fn backers_of( who: &Author<T>, ) -> Result<Vec<(Self::Backer, Self::Asset)>, DispatchError>

Returns all backers currently funding the given author along with their real-time contributions.

This excludes the author’s own collateral as only external backers are returned.

This function iterates over each registered funder for the author and retrieves their committed value:

  • Direct: Returns the committed amount.
  • Index: Fetches the value of the author’s (entry’s) digest within the index’s digest’s entries.
  • Pool: Fetches the value of the author’s (slot’s) digest within the pool’s digest’s slots.

Returns a vector of (Backer, Asset) tuples or a DispatchError if any validation fails.

Source§

fn backed_for( by: &Self::Backer, ) -> Result<Vec<(Author<T>, Self::Asset)>, DispatchError>

Returns all authors currently funded by the given backer as external funding along with their real-time contributions.

Behavior varies by backer type:

  • Direct: Expected to fund a single author; retrieves the commit digest and value.
  • Index: Can fund multiple authors; retrieves all index entries as digests and values for the backing account.
  • Pool: Can fund multiple authors; retrieves all pool slots as digests and values for the backing account.

After retrieving digests and values, this function resolves each digest to the corresponding author and ensures that the author exists.

Returns a vector of (Author, Asset) tuples, or a DispatchError if validation fails.

Source§

fn get_fund( who: &Author<T>, by: &Self::Backer, ) -> Result<Self::Asset, DispatchError>

Returns the real-time contribution a specific backer has funded to the given author.

Behavior varies by backer type:

  • Direct: Expects a single author; verifies that the digest maps to the given author.
  • Index: Returns the value of the author’s entry in the index for the backer account.
  • Pool: Returns the value of the author’s slot in the pool for the backer account.

Returns the funded Asset or a DispatchError if validation fails.

Source§

fn on_drawn(who: &Author<T>, by: &Self::Backer, amount: Self::Asset)

Hook invoked after a backer withdraws previously committed funds from an author, via direct, index, or pool commitments.

For index or pool backers, the emitted amount represents the aggregated withdrawal applied across all associated authors.

Emits any one of event if Config::EmitEvents is true. - Direct Author: Event::AuthorDrawn - Index: Event::IndexDrawn - Pool: Event::PoolDrawn

Source§

fn on_funded(who: &Author<T>, by: &Self::Backer, amount: Self::Asset)

Hook invoked after an author is successfully funded by a backer.

For index or pool backers, the emitted amount represents the aggregated deposit distributed across all associated authors.

Emits any one of event if Config::EmitEvents is true. - Direct Author: Event::AuthorFunded - Index: Event::IndexFunded - Pool: Event::PoolFunded

Source§

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

Source§

type InCodeStorageVersion = NoStorageVersionSet

This type is generated by the pallet macro. Read more
Source§

fn in_code_storage_version() -> Self::InCodeStorageVersion

Returns the in-code storage version as specified in the storage_version attribute, or [NoStorageVersionSet] if the attribute is missing.
Source§

fn on_chain_storage_version() -> StorageVersion

Returns the storage version of the pallet as last set in the actual on-chain storage.
§

fn current_storage_version() -> Self::InCodeStorageVersion

👎Deprecated: This method has been renamed to in_code_storage_version and will be removed after March 2024.
DEPRECATED: Use [Self::current_storage_version] instead. Read more
Source§

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

Source§

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

Apply scheduled author rewards and penalties at the start of each block.

  • Rewards and penalties must be processed before any new extrinsics or elections in the current block to ensure that subsequent computations are accurate.
  • By processing at the start, we disallow querying or relying on the current block’s rewards/penalties until the next block, ensuring deterministic behavior and avoiding double-counting or race conditions.
  • Rewards/penalties are applied once per block at the beginning.
  • This ensures deterministic, predictable state transitions, and makes querying the pallet consistent (no author sees their reward/penalty applied mid-block).
§

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_poll(_n: BlockNumber, _weight: &mut WeightMeter)

A hook to run logic after inherent application. Read more
§

fn on_runtime_upgrade() -> Weight

Hook executed when a code change (aka. a “runtime upgrade”) is detected by the FRAME Executive pallet. 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 blockchain execution. 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> OnPoll<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>

Source§

fn on_poll(n: BlockNumberFor<T>, weight: &mut WeightMeter)

Code to execute every now and then at the beginning of the block after inherent application. Read more
Source§

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

Source§

fn on_runtime_upgrade() -> Weight

See [Hooks::on_runtime_upgrade].
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 for Pallet<T>

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

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

Implements the RoleManager trait for the Author subsystem

Defines how authors behave as role-bearing entities within the runtime.

Source§

type Status = AuthorStatus

The possible states of an Author role.

Variants:

  • Active : Author is actively participating.
  • Probation : Author is under review or subject to restrictions.
  • Resigned : Author voluntarily left the role.

Note: There is no explicit suspension; penalties and probation are applied to enforce decentralization.

Source§

type Meta = AuthorInfo<T>

The meta-information of an Author role.

Source§

type Asset = <<T as Config>::CommitmentAdapter as InspectAsset<<T as Config>::AccountId>>::Asset

The type representing the collateral or hold of an Author role.

Source§

type TimeStamp = <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number

Timestamp type used for enrollment or status tracking.

Source§

fn role_exists(who: &Author<T>) -> DispatchResult

Checks whether the given Author exists in the system.

Returns:

  • Ok(()) if the author exists.
  • Err(DispatchError) otherwise.
Source§

fn get_meta(who: &Author<T>) -> Result<Self::Meta, DispatchError>

Retrieves the meta-data of the given Author if available.

Returns:

  • Ok(Meta) if the author exists.
  • Err(DispatchError) otherwise.
Source§

fn get_collateral(who: &Author<T>) -> Result<Self::Asset, DispatchError>

Retrieves the amount of collateral currently locked by an Author during enrollment.

This ensures real-time accuracy, reflecting any updates to the collateral.

  • Does not check author validaity, since commitment call reflects if the pallet-gated collateral reason is funded by the given author
  • Invariant: FreezeReason::AuthorCollateral must only be utilized by this pallet
  • Invariant: Ensures the collateral must be non-zero, or else most of the functions will fail.

Returns the collateral value or a DispatchError otherwise.

Source§

fn total_collateral() -> Self::Asset

Retrieves the amount of collateral currently locked by all Authors during enrollment.

This ensures real-time accuracy, reflecting any updates to any collaterals.

Source§

fn enroll_since(who: &Author<T>) -> Result<Self::TimeStamp, DispatchError>

Returns the block number when the Author enrolled in the role.

DispatchError otherwise

Source§

fn get_status(who: &Author<T>) -> Result<Self::Status, DispatchError>

Retrieves the current status of the given Author.

Status can be one of:

  • Active
  • Probation
  • Resigned

DispatchError otherwise

Source§

fn status_since(who: &Author<T>) -> Result<Self::TimeStamp, DispatchError>

Returns the timestamp (block number) when the author’s current status was last updated.

This can be used to track how long an author has been in a specific state (e.g., probation, active, resigned) and enforce time-based rules.

DispatchError otherwise.

Source§

fn set_status(who: &Author<T>, status: Self::Status) -> DispatchResult

Updates the status of an author in a safe, controlled way.

It doesn’t mutate status directly, but enforces validations to proceed.

DispatchError otherwise.

Source§

fn can_enroll(who: &Author<T>, collateral: Self::Asset) -> DispatchResult

Validates whether an Author can enroll with the given collateral.

Checks include:

  • If the status is Resigned, enrollment is allowed (re-entry).
  • Ensures the provided collateral meets the minimum requirement.

Returns:

  • Ok(()) if all checks pass.
  • `Err(DispatchError) otheriwse.
Source§

fn enroll( who: &Author<T>, collateral: Self::Asset, force: Fortitude, ) -> Result<Self::Asset, DispatchError>

Enrolls a new author with the specified collateral and the operation’s priviledge via force.

Steps performed:

  • Ensure the author is eligible and the collateral meets minimum requirements.
  • Generate a unique digest/hash for this author’s funding commitment.
  • Lock the collateral using the commitment adapter.
  • Register the author in storage and maintain lookup maps.

For Resigned Authors Enrollment, their commitment-digest is reused.

§force Semantics
  • [Fortitude::Polite]: Uses funds from the commitment reserve.
  • [Fortitude::Force]: Uses funds from the user’s liquid balance.

Prefer Polite when collateral is pre-reserved; otherwise use Force.

This operation will never kill an account, as guaranteed by the commitment system.

§Errors
  • Returns the actual amount of collateral successfully reserved.
  • Returns a DispatchError if fails.
Source§

fn can_resign(who: &Author<T>) -> DispatchResult

Validates whether an Author can safely resign from the role.

Checks include:

  • Author in Probation cannot resign (must resolve probation first).
  • Ensures there are no pending penalties.
  • Ensures the author is not currently active in duties (cannot resign while active).

Pending rewards are ignored, as its voluntary for author to resign before receiving the rewards, whereas the backers are unaffected for receiving.

Returns:

  • Ok(()) if all conditions are met.
  • `Err(DispatchError) otherwise.
Source§

fn resign(who: &Author<T>) -> Result<Self::Asset, DispatchError>

Resigns an author, releasing collateral and updating status.

Marks author’s status as Resigned (so funders may withdraw their funds later).

If an author’s metadata is ever reaped, a separate, safety-checked procedure MUST ensure that all funders have fully withdrawn their commitments. Only once this invariant holds it is safe to issue a new digest and purge the old entry from AuthorsDigest during re-enrollment.

This function does not perform those checks and MUST NOT be used for that purpose.

Returns the refunded collateral of the author. DispatchError otherwise.

Source§

fn add_collateral( who: &Author<T>, collateral: Self::Asset, force: Fortitude, ) -> Result<Self::Asset, DispatchError>

Increases the collateral for an Author with the specified collateral and the operation’s priviledge (force).

If the existing collateral (before raising/adding) is lesser than the system enforced minimum, this function uses [Precision::Exact] else [Precision::BestEffort].

force determines the source of funds:

  • [Fortitude::Polite]: commitment reserve
  • [Fortitude::Force]: liquid balance

Returns the actually raised collateral (not full collateral). DispatchError otherwise.

Source§

fn is_available(who: &Author<T>) -> DispatchResult

Checks if the author is not defaulted (available).

  • Active or Probation authors are not considered defaulted (returns error).
  • Resigned authors are treated as defaulted.
  • Lesser Collateral will result in author being defaulted.
Source§

fn on_enroll(who: &Author<T>, collateral: Self::Asset)

Hook invoked after an author is successfully enrolled.

Emits Event::AuthorEnlisted if Config::EmitEvents is true.

Source§

fn on_resign(who: &Author<T>, released: Self::Asset)

Hook invoked when an author resignation is processed.

Emits Event::AuthorResigned if Config::EmitEvents is true.

Source§

fn on_add_collateral(who: &Author<T>, raised: Self::Asset)

Hook invoked after an author’s collateral balance is incremented.

Emits Event::AuthorCollateralRaised if Config::EmitEvents is true.

Source§

fn on_status_update(who: &Author<T>, status: &Self::Status)

Hook invoked after an author’s status is mutated or updated.

Emits Event::AuthorStatus if Config::EmitEvents is true.

Source§

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

Implements the RoleProbation trait for the Author subsystem

Defines how authors can be switched between probation and permenance with certain invariants enforced for good behavior.

Source§

fn is_on_probation(who: &Author<T>) -> DispatchResult

Checks if the author is currently under probation.

Returns Ok(()) if the author is in Probation status. DispatchError of current status of author otherwise.

Source§

fn is_permanent(who: &Author<T>) -> DispatchResult

Checks if the author has secured permanent (active) status.

Returns Ok(()) if the author is Active (permanent). DispatchError of current status of author otherwise.

Source§

fn can_be_permanent(who: &Author<T>) -> DispatchResult

Checks if the given author is eligible to become permanent.

Evaluates risk status and requires author in probation.

  • Returns Ok(()) if the author can be promoted to permanent status.
  • Returns Err(DispatchError) otherwise.
Source§

fn set_permanence(who: &Author<T>) -> Result<Self::Status, DispatchError>

Promotes an author to permanent/active status.

Returns Ok(AuthorStatus::Active) on success or Err(DispatchError) otherwise.

Source§

fn can_revoke_permanence(who: &Author<T>) -> DispatchResult

Checks if the given author is eligible to be placed back under probation.

Passes if indication of significant risk on active authors.

  • Returns Ok(()) if the author can be probated.
  • Returns Err(DispatchError) if the author is already in probation, resigned, or cannot be probated.
Source§

fn revoke_permanence(who: &Author<T>) -> Result<Self::Status, DispatchError>

Revokes an author’s permanent/active status and places them back under probation.

Returns Ok(AuthorStatus::Probation) on success or Err(DispatchError) otherwise.

Source§

fn risk_probation(who: &Author<T>) -> DispatchResult

Marks a probationary author as at risk, extending their risk magnitude.

  • Returns Ok(()) on success or Err(DispatchError) otherwise.
Source§

fn risk_permanence(who: &Author<T>) -> DispatchResult

Marks a permanent/active author as at risk, potentially impacting their permanence.

  • Returns Ok(()) on success or Err(DispatchError) otherwise.
Source§

fn secure_permanence(who: &Author<T>) -> DispatchResult

Reduces the risk period for an author, securing their permanence.

  • Returns Ok(()) on success or Err(DispatchError) otherwise.
Source§

fn on_set_permance(who: &Author<T>)

Hook invoked after an author is promoted to permanent (Active) status.

Emits Event::AuthorStatus if Config::EmitEvents is true.

Source§

fn on_revoke_permanence(who: &Author<T>)

Hook invoked after an author’s permanence is revoked.

Emits Event::AuthorStatus if Config::EmitEvents is true.

Source§

fn on_risk_permanence(who: &Author<T>)

Hook invoked when risk is applied to an author increasing their risk towards disinheriting permanace.

Emits Event::AuthorAtRisk if Config::EmitEvents is true.

Source§

fn on_risk_probation(who: &Author<T>)

Hook invoked when risk is applied to an author increasing their risk to inherit permanace.

Emits Event::AuthorAtRisk if Config::EmitEvents is true.

Source§

fn on_secure_permanence(who: &Author<T>)

Hook invoked when risk is reduced to an author increasing their oppurtunity to inherit permanace.

Emits Event::AuthorAtRisk if Config::EmitEvents is true.

Source§

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

Source§

fn storage_info() -> Vec<StorageInfo>

Source§

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

Source§

fn prefix() -> [u8; 16]

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> 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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
§

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
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

§

impl<Q, K> Equivalent<K> for Q
where 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<Q, K> Equivalent<K> for Q
where 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
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 T
where 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, U> IntoKey<U> for T
where U: FromKey<T>,

§

fn into_key(self) -> U

Source§

impl<T, U, Tag> IntoTag<U, Tag> for T
where U: FromTag<T, Tag>, Tag: DiscriminantTag,

Source§

fn into_tag(self) -> U

§

impl<Src, Dest> IntoTuple<Dest> for Src
where Dest: FromTuple<Src>,

§

fn into_tuple(self) -> Dest

§

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 T
where 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.

Source§

impl<T, Time> Logging<Time> for T
where Time: Time,

Source§

const FALLBACK_TARGET: &'static str = "routine"

Default logging target if none is provided.

Most routines, especially offchain workers or background tasks, use this target for simplicity.

It allows a consistent place to look for routine logs without requiring every call to specify a target.

Note: This target is only a conveninence and may be somewhat vague. To ensure errors can still be traced accurately, the logged messages should include additional metadata (e.g., module name, error index, or contextual info) so that the source of the error can be identified even if the target is generic.

Source§

type Logger = DispatchError

The type taken and returned for logging.

We simply return the same [DispatchError] that was logged, so logging does not change control flow or error propagation.

DispatchError is used because in Substrate it encompasses all runtime errors - including module errors, token errors, arithmetic issues, and transactional boundaries - making it the universal substrate-side error representation.

Source§

type Level = LogLevel

The log level type.

We use the LogLevel enum to standardize severity levels (Info, Warn, Error, Debug) across all routine logs.

Source§

fn log( level: <T as Logging<Time>>::Level, err: &<T as Logging<Time>>::Logger, timestamp: Time, target: Option<&str>, fmt: Option<fn(Time, &<T as Logging<Time>>::Level, &str, &str) -> String>, ) -> <T as Logging<Time>>::Logger

Core logging function that all helpers delegate to. Read more
Source§

fn info( err: &Self::Logger, timestamp: Timestamp, target: Option<&str>, fmt: Option<fn(Timestamp, &Self::Level, &str, &str) -> String>, ) -> Self::Logger
where Self: Sized,

Logs an info-level message. Read more
Source§

fn warn( err: &Self::Logger, timestamp: Timestamp, target: Option<&str>, fmt: Option<fn(Timestamp, &Self::Level, &str, &str) -> String>, ) -> Self::Logger
where Self: Sized,

Logs a warning-level message. Read more
Source§

fn error( err: &Self::Logger, timestamp: Timestamp, target: Option<&str>, fmt: Option<fn(Timestamp, &Self::Level, &str, &str) -> String>, ) -> Self::Logger
where Self: Sized,

Logs an error-level message. Read more
Source§

fn debug( err: &Self::Logger, timestamp: Timestamp, target: Option<&str>, fmt: Option<fn(Timestamp, &Self::Level, &str, &str) -> String>, ) -> Self::Logger
where Self: Sized,

Logs a debug-level message. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

impl<T> SaturatedConversion for T

§

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

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

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

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

impl<T> ToOwned for T
where T: Clone,

Source§

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
Source§

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

Source§

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 T
where U: TryFrom<T>,

Source§

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<T, U> TryIntoKey<U> for T
where 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 S
where T: UncheckedFrom<S>,

§

fn unchecked_into(self) -> T

The counterpart to unchecked_from.
§

impl<T, S> UniqueSaturatedInto<T> for S
where 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 T
where 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
Source§

impl<Provider, Discriminant, T> DelegateVirtualDynBound<Provider, Discriminant> for T
where Provider: VirtualDynBound<Discriminant>, Discriminant: DiscriminantTag,

Source§

impl<Provider, Discriminant, T> DelegateVirtualStaticBound<Provider, Discriminant> for T
where Provider: VirtualStaticBound<Discriminant>, Discriminant: DiscriminantTag,

§

impl<T> JsonSchemaMaybe for T

§

impl<T> MaybeDebug for T
where T: Debug,

§

impl<T> MaybeRefUnwindSafe for T
where T: RefUnwindSafe,

§

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