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

The Pallet struct, the main type that implements traits and standalone functions within the pallet.

Tuple Fields§

§0: PhantomData<T>

Implementations§

source§

impl<T: Config> Pallet<T>

source

pub fn schedule( origin: OriginFor<T>, when: BlockNumberFor<T>, maybe_periodic: Option<Period<BlockNumberFor<T>>>, priority: Priority, call: Box<<T as Config>::RuntimeCall> ) -> DispatchResult

Anonymously schedule a task.

source

pub fn cancel( origin: OriginFor<T>, when: BlockNumberFor<T>, index: u32 ) -> DispatchResult

Cancel an anonymously scheduled task.

source

pub fn schedule_named( origin: OriginFor<T>, id: TaskName, when: BlockNumberFor<T>, maybe_periodic: Option<Period<BlockNumberFor<T>>>, priority: Priority, call: Box<<T as Config>::RuntimeCall> ) -> DispatchResult

Schedule a named task.

source

pub fn cancel_named(origin: OriginFor<T>, id: TaskName) -> DispatchResult

Cancel a named scheduled task.

source

pub fn schedule_after( origin: OriginFor<T>, after: BlockNumberFor<T>, maybe_periodic: Option<Period<BlockNumberFor<T>>>, priority: Priority, call: Box<<T as Config>::RuntimeCall> ) -> DispatchResult

Anonymously schedule a task after a delay.

source

pub fn schedule_named_after( origin: OriginFor<T>, id: TaskName, after: BlockNumberFor<T>, maybe_periodic: Option<Period<BlockNumberFor<T>>>, priority: Priority, call: Box<<T as Config>::RuntimeCall> ) -> DispatchResult

Schedule a named task after a delay.

source

pub fn set_retry( origin: OriginFor<T>, task: TaskAddress<BlockNumberFor<T>>, retries: u8, period: BlockNumberFor<T> ) -> DispatchResult

Set a retry configuration for a task so that, in case its scheduled run fails, it will be retried after period blocks, for a total amount of retries retries or until it succeeds.

Tasks which need to be scheduled for a retry are still subject to weight metering and agenda space, same as a regular task. If a periodic task fails, it will be scheduled normally while the task is retrying.

Tasks scheduled as a result of a retry for a periodic task are unnamed, non-periodic clones of the original task. Their retry configuration will be derived from the original task’s configuration, but will have a lower value for remaining than the original total_retries.

source

pub fn set_retry_named( origin: OriginFor<T>, id: TaskName, retries: u8, period: BlockNumberFor<T> ) -> DispatchResult

Set a retry configuration for a named task so that, in case its scheduled run fails, it will be retried after period blocks, for a total amount of retries retries or until it succeeds.

Tasks which need to be scheduled for a retry are still subject to weight metering and agenda space, same as a regular task. If a periodic task fails, it will be scheduled normally while the task is retrying.

Tasks scheduled as a result of a retry for a periodic task are unnamed, non-periodic clones of the original task. Their retry configuration will be derived from the original task’s configuration, but will have a lower value for remaining than the original total_retries.

source

pub fn cancel_retry( origin: OriginFor<T>, task: TaskAddress<BlockNumberFor<T>> ) -> DispatchResult

Removes the retry configuration of a task.

source

pub fn cancel_retry_named(origin: OriginFor<T>, id: TaskName) -> DispatchResult

Cancel the retry configuration of a named task.

source§

impl<T: Config> Pallet<T>

source

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

source§

impl<T: Config> Pallet<T>

source

pub fn migrate_v1_to_v4() -> Weight

Migrate storage format from V1 to V4.

Returns the weight consumed by this migration.

source

pub fn migrate_v2_to_v4() -> Weight

Migrate storage format from V2 to V4.

Returns the weight consumed by this migration.

source

pub fn migrate_v3_to_v4() -> Weight

Migrate storage format from V3 to V4.

Returns the weight consumed by this migration.

source§

impl<T: Config> Pallet<T>

source

pub fn migrate_origin<OldOrigin: Into<T::PalletsOrigin> + Decode>()

Helper to migrate scheduler when the pallet origin type has changed.

source

pub(crate) fn resolve_time( when: DispatchTime<BlockNumberFor<T>> ) -> Result<BlockNumberFor<T>, DispatchError>

source

pub(crate) fn place_task( when: BlockNumberFor<T>, what: ScheduledOf<T> ) -> Result<TaskAddress<BlockNumberFor<T>>, (DispatchError, ScheduledOf<T>)>

source

pub(crate) fn push_to_agenda( when: BlockNumberFor<T>, what: ScheduledOf<T> ) -> Result<u32, (DispatchError, ScheduledOf<T>)>

source

pub(crate) fn cleanup_agenda(when: BlockNumberFor<T>)

Remove trailing None items of an agenda at when. If all items are None remove the agenda record entirely.

source

pub(crate) fn do_schedule( when: DispatchTime<BlockNumberFor<T>>, maybe_periodic: Option<Period<BlockNumberFor<T>>>, priority: Priority, origin: T::PalletsOrigin, call: BoundedCallOf<T> ) -> Result<TaskAddress<BlockNumberFor<T>>, DispatchError>

source

pub(crate) fn do_cancel( origin: Option<T::PalletsOrigin>, (when, index): TaskAddress<BlockNumberFor<T>> ) -> Result<(), DispatchError>

source

pub(crate) fn do_reschedule( (when, index): TaskAddress<BlockNumberFor<T>>, new_time: DispatchTime<BlockNumberFor<T>> ) -> Result<TaskAddress<BlockNumberFor<T>>, DispatchError>

source

pub(crate) fn do_schedule_named( id: TaskName, when: DispatchTime<BlockNumberFor<T>>, maybe_periodic: Option<Period<BlockNumberFor<T>>>, priority: Priority, origin: T::PalletsOrigin, call: BoundedCallOf<T> ) -> Result<TaskAddress<BlockNumberFor<T>>, DispatchError>

source

pub(crate) fn do_cancel_named( origin: Option<T::PalletsOrigin>, id: TaskName ) -> DispatchResult

source

pub(crate) fn do_reschedule_named( id: TaskName, new_time: DispatchTime<BlockNumberFor<T>> ) -> Result<TaskAddress<BlockNumberFor<T>>, DispatchError>

source

pub(crate) fn do_cancel_retry( origin: &T::PalletsOrigin, (when, index): TaskAddress<BlockNumberFor<T>> ) -> Result<(), DispatchError>

source§

impl<T: Config> Pallet<T>

source

pub(crate) fn service_agendas( weight: &mut WeightMeter, now: BlockNumberFor<T>, max: u32 )

Service up to max agendas queue starting from earliest incompletely executed agenda.

source

pub(crate) fn service_agenda( weight: &mut WeightMeter, executed: &mut u32, now: BlockNumberFor<T>, when: BlockNumberFor<T>, max: u32 ) -> bool

Returns true if the agenda was fully completed, false if it should be revisited at a later block.

source

pub(crate) fn service_task( weight: &mut WeightMeter, now: BlockNumberFor<T>, when: BlockNumberFor<T>, agenda_index: u32, is_first: bool, task: ScheduledOf<T> ) -> Result<(), (ServiceTaskError, Option<ScheduledOf<T>>)>

Service (i.e. execute) the given task, being careful not to overflow the weight counter.

This involves:

  • removing and potentially replacing the Lookup entry for the task.
  • realizing the task’s call which can include a preimage lookup.
  • Rescheduling the task for execution in a later agenda if periodic.
source

pub(crate) fn execute_dispatch( weight: &mut WeightMeter, origin: T::PalletsOrigin, call: <T as Config>::RuntimeCall ) -> Result<DispatchResult, ()>

Make a dispatch to the given call from the given origin, ensuring that the weight counter does not exceed its limit and that it is counted accurately (e.g. accounted using post info if available).

NOTE: Only the weight for this function will be counted (origin lookup, dispatch and the call itself).

Returns an error if the call is overweight.

source

pub(crate) fn schedule_retry( weight: &mut WeightMeter, now: BlockNumberFor<T>, when: BlockNumberFor<T>, agenda_index: u32, task: &ScheduledOf<T>, retry_config: RetryConfig<BlockNumberFor<T>> )

Check if a task has a retry configuration in place and, if so, try to reschedule it.

Possible causes for failure to schedule a retry for a task:

  • there wasn’t enough weight to run the task reschedule logic
  • there was no retry configuration in place
  • there were no more retry attempts left
  • the agenda was full.
source

pub(crate) fn ensure_privilege( left: &<T as Config>::PalletsOrigin, right: &<T as Config>::PalletsOrigin ) -> Result<(), DispatchError>

Ensure that left has at least the same level of privilege or higher than right.

Returns an error if left has a lower level of privilege or the two cannot be compared.

Trait Implementations§

source§

impl<T: Config> Anon<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, <T as Config>::RuntimeCall, <T as Config>::PalletsOrigin> for Pallet<T>

§

type Address = (<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, u32)

👎Deprecated: Use v3 instead. Will be removed after September 2024.
An address which can be used for removing a scheduled task.
§

type Hash = <T as Config>::Hash

👎Deprecated: Use v3 instead. Will be removed after September 2024.
A means of expressing a call by the hash of its encoded data.
source§

fn schedule( when: DispatchTime<BlockNumberFor<T>>, maybe_periodic: Option<Period<BlockNumberFor<T>>>, priority: Priority, origin: T::PalletsOrigin, call: CallOrHashOf<T> ) -> Result<Self::Address, DispatchError>

👎Deprecated: Use v3 instead. Will be removed after September 2024.
Schedule a dispatch to happen at the beginning of some block in the future. Read more
source§

fn cancel((when, index): Self::Address) -> Result<(), ()>

👎Deprecated: Use v3 instead. Will be removed after September 2024.
Cancel a scheduled task. If periodic, then it will cancel all further instances of that, also. Read more
source§

fn reschedule( address: Self::Address, when: DispatchTime<BlockNumberFor<T>> ) -> Result<Self::Address, DispatchError>

👎Deprecated: Use v3 instead. Will be removed after September 2024.
Reschedule a task. For one-off tasks, this dispatch is guaranteed to succeed only if it is executed before the currently scheduled block. For periodic tasks, this dispatch is guaranteed to succeed only before the initial execution; for others, use reschedule_named. Read more
source§

fn next_dispatch_time( (when, index): Self::Address ) -> Result<BlockNumberFor<T>, ()>

👎Deprecated: Use v3 instead. Will be removed after September 2024.
Return the next dispatch time for a given task. Read more
source§

impl<T: Config> Anon<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, <T as Config>::RuntimeCall, <T as Config>::PalletsOrigin> for Pallet<T>

§

type Address = (<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, u32)

An address which can be used for removing a scheduled task.
§

type Hasher = <T as Config>::Hashing

The hasher used in the runtime.
source§

fn schedule( when: DispatchTime<BlockNumberFor<T>>, maybe_periodic: Option<Period<BlockNumberFor<T>>>, priority: Priority, origin: T::PalletsOrigin, call: BoundedCallOf<T> ) -> Result<Self::Address, DispatchError>

Schedule a dispatch to happen at the beginning of some block in the future. Read more
source§

fn cancel((when, index): Self::Address) -> Result<(), DispatchError>

Cancel a scheduled task. If periodic, then it will cancel all further instances of that, also. Read more
source§

fn reschedule( address: Self::Address, when: DispatchTime<BlockNumberFor<T>> ) -> Result<Self::Address, DispatchError>

Reschedule a task. For one-off tasks, this dispatch is guaranteed to succeed only if it is executed before the currently scheduled block. For periodic tasks, this dispatch is guaranteed to succeed only before the initial execution; for others, use reschedule_named. Read more
source§

fn next_dispatch_time( (when, index): Self::Address ) -> Result<BlockNumberFor<T>, DispatchError>

Return the next dispatch time for a given task. Read more
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,

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

§

type InCodeStorageVersion = StorageVersion

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(now: BlockNumberFor<T>) -> Weight

Execute the scheduled calls

§

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> Named<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, <T as Config>::RuntimeCall, <T as Config>::PalletsOrigin> for Pallet<T>

§

type Address = (<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, u32)

An address which can be used for removing a scheduled task.
§

type Hasher = <T as Config>::Hashing

The hasher used in the runtime.
source§

fn schedule_named( id: TaskName, when: DispatchTime<BlockNumberFor<T>>, maybe_periodic: Option<Period<BlockNumberFor<T>>>, priority: Priority, origin: T::PalletsOrigin, call: BoundedCallOf<T> ) -> Result<Self::Address, DispatchError>

Schedule a dispatch to happen at the beginning of some block in the future. Read more
source§

fn cancel_named(id: TaskName) -> Result<(), DispatchError>

Cancel a scheduled, named task. If periodic, then it will cancel all further instances of that, also. Read more
source§

fn reschedule_named( id: TaskName, when: DispatchTime<BlockNumberFor<T>> ) -> Result<Self::Address, DispatchError>

Reschedule a task. For one-off tasks, this dispatch is guaranteed to succeed only if it is executed before the currently scheduled block. Read more
source§

fn next_dispatch_time(id: TaskName) -> Result<BlockNumberFor<T>, DispatchError>

Return the next dispatch time for a given task. Read more
source§

impl<T: Config> Named<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, <T as Config>::RuntimeCall, <T as Config>::PalletsOrigin> for Pallet<T>

§

type Address = (<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, u32)

👎Deprecated: Use v3 instead. Will be removed after September 2024.
An address which can be used for removing a scheduled task.
§

type Hash = <T as Config>::Hash

👎Deprecated: Use v3 instead. Will be removed after September 2024.
A means of expressing a call by the hash of its encoded data.
source§

fn schedule_named( id: Vec<u8>, when: DispatchTime<BlockNumberFor<T>>, maybe_periodic: Option<Period<BlockNumberFor<T>>>, priority: Priority, origin: T::PalletsOrigin, call: CallOrHashOf<T> ) -> Result<Self::Address, ()>

👎Deprecated: Use v3 instead. Will be removed after September 2024.
Schedule a dispatch to happen at the beginning of some block in the future. Read more
source§

fn cancel_named(id: Vec<u8>) -> Result<(), ()>

👎Deprecated: Use v3 instead. Will be removed after September 2024.
Cancel a scheduled, named task. If periodic, then it will cancel all further instances of that, also. Read more
source§

fn reschedule_named( id: Vec<u8>, when: DispatchTime<BlockNumberFor<T>> ) -> Result<Self::Address, DispatchError>

👎Deprecated: Use v3 instead. Will be removed after September 2024.
Reschedule a task. For one-off tasks, this dispatch is guaranteed to succeed only if it is executed before the currently scheduled block.
source§

fn next_dispatch_time(id: Vec<u8>) -> Result<BlockNumberFor<T>, ()>

👎Deprecated: Use v3 instead. Will be removed after September 2024.
Return the next dispatch time for a given task. Read more
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

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

source§

fn storage_info() -> Vec<StorageInfo>

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§

§

impl<T, BlockNumber, Call, RuntimeOrigin> Anon<BlockNumber, Call, RuntimeOrigin> for T
where T: Anon<BlockNumber, Call, RuntimeOrigin>,

§

type Address = <T as Anon<BlockNumber, Call, RuntimeOrigin>>::Address

👎Deprecated: Use v3 instead. Will be removed after September 2024.
An address which can be used for removing a scheduled task.
§

fn schedule( when: DispatchTime<BlockNumber>, maybe_periodic: Option<(BlockNumber, u32)>, priority: u8, origin: RuntimeOrigin, call: Call ) -> Result<<T as Anon<BlockNumber, Call, RuntimeOrigin>>::Address, DispatchError>

👎Deprecated: Use v3 instead. Will be removed after September 2024.
Schedule a dispatch to happen at the beginning of some block in the future. Read more
§

fn cancel( address: <T as Anon<BlockNumber, Call, RuntimeOrigin>>::Address ) -> Result<(), ()>

👎Deprecated: Use v3 instead. Will be removed after September 2024.
Cancel a scheduled task. If periodic, then it will cancel all further instances of that, also. Read more
§

fn reschedule( address: <T as Anon<BlockNumber, Call, RuntimeOrigin>>::Address, when: DispatchTime<BlockNumber> ) -> Result<<T as Anon<BlockNumber, Call, RuntimeOrigin>>::Address, DispatchError>

👎Deprecated: Use v3 instead. Will be removed after September 2024.
Reschedule a task. For one-off tasks, this dispatch is guaranteed to succeed only if it is executed before the currently scheduled block. For periodic tasks, this dispatch is guaranteed to succeed only before the initial execution; for others, use reschedule_named. Read more
§

fn next_dispatch_time( address: <T as Anon<BlockNumber, Call, RuntimeOrigin>>::Address ) -> Result<BlockNumber, ()>

👎Deprecated: Use v3 instead. Will be removed after September 2024.
Return the next dispatch time for a given task. Read more
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> DynClone for T
where T: Clone,

source§

impl<Q, K> Equivalent<K> for Q
where 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 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

§

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.

§

impl<T, BlockNumber, Call, RuntimeOrigin> Named<BlockNumber, Call, RuntimeOrigin> for T
where T: Named<BlockNumber, Call, RuntimeOrigin>,

§

type Address = <T as Named<BlockNumber, Call, RuntimeOrigin>>::Address

👎Deprecated: Use v3 instead. Will be removed after September 2024.
An address which can be used for removing a scheduled task.
§

fn schedule_named( id: Vec<u8>, when: DispatchTime<BlockNumber>, maybe_periodic: Option<(BlockNumber, u32)>, priority: u8, origin: RuntimeOrigin, call: Call ) -> Result<<T as Named<BlockNumber, Call, RuntimeOrigin>>::Address, ()>

👎Deprecated: Use v3 instead. Will be removed after September 2024.
Schedule a dispatch to happen at the beginning of some block in the future. Read more
§

fn cancel_named(id: Vec<u8>) -> Result<(), ()>

👎Deprecated: Use v3 instead. Will be removed after September 2024.
Cancel a scheduled, named task. If periodic, then it will cancel all further instances of that, also. Read more
§

fn reschedule_named( id: Vec<u8>, when: DispatchTime<BlockNumber> ) -> Result<<T as Named<BlockNumber, Call, RuntimeOrigin>>::Address, DispatchError>

👎Deprecated: Use v3 instead. Will be removed after September 2024.
Reschedule a task. For one-off tasks, this dispatch is guaranteed to succeed only if it is executed before the currently scheduled block.
§

fn next_dispatch_time(id: Vec<u8>) -> Result<BlockNumber, ()>

👎Deprecated: Use v3 instead. Will be removed after September 2024.
Return the next dispatch time for a given task. Read more
§

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

§

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
§

impl<SS, SP> SupersetOf<SS> for SP
where 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.
source§

impl<T> ToOwned for T
where 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
source§

impl<T, U> TryFrom<U> for T
where 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 T
where 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<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
§

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,

source§

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