Struct pallet_scheduler::pallet::Pallet [−][src]
pub struct Pallet<T>(_);
Expand description
The pallet implementing the on-chain logic.
Implementations
pub fn schedule(
origin: OriginFor<T>,
when: T::BlockNumber,
maybe_periodic: Option<Period<T::BlockNumber>>,
priority: Priority,
call: Box<<T as Config>::Call>
) -> DispatchResult
pub fn schedule(
origin: OriginFor<T>,
when: T::BlockNumber,
maybe_periodic: Option<Period<T::BlockNumber>>,
priority: Priority,
call: Box<<T as Config>::Call>
) -> DispatchResult
pub fn schedule_named(
origin: OriginFor<T>,
id: Vec<u8>,
when: T::BlockNumber,
maybe_periodic: Option<Period<T::BlockNumber>>,
priority: Priority,
call: Box<<T as Config>::Call>
) -> DispatchResult
pub fn schedule_named(
origin: OriginFor<T>,
id: Vec<u8>,
when: T::BlockNumber,
maybe_periodic: Option<Period<T::BlockNumber>>,
priority: Priority,
call: Box<<T as Config>::Call>
) -> DispatchResult
pub fn schedule_after(
origin: OriginFor<T>,
after: T::BlockNumber,
maybe_periodic: Option<Period<T::BlockNumber>>,
priority: Priority,
call: Box<<T as Config>::Call>
) -> DispatchResult
pub fn schedule_after(
origin: OriginFor<T>,
after: T::BlockNumber,
maybe_periodic: Option<Period<T::BlockNumber>>,
priority: Priority,
call: Box<<T as Config>::Call>
) -> DispatchResult
pub fn schedule_named_after(
origin: OriginFor<T>,
id: Vec<u8>,
after: T::BlockNumber,
maybe_periodic: Option<Period<T::BlockNumber>>,
priority: Priority,
call: Box<<T as Config>::Call>
) -> DispatchResult
pub fn schedule_named_after(
origin: OriginFor<T>,
id: Vec<u8>,
after: T::BlockNumber,
maybe_periodic: Option<Period<T::BlockNumber>>,
priority: Priority,
call: Box<<T as Config>::Call>
) -> DispatchResult
Migrate storage format from V1 to V2. Return true if migration is performed.
Helper to migrate scheduler when the pallet origin type has changed.
Trait Implementations
impl<T: Config> Anon<<T as Config>::BlockNumber, <T as Config>::Call, <T as Config>::PalletsOrigin> for Pallet<T>
impl<T: Config> Anon<<T as Config>::BlockNumber, <T as Config>::Call, <T as Config>::PalletsOrigin> for Pallet<T>
type Address = TaskAddress<T::BlockNumber>
type Address = TaskAddress<T::BlockNumber>
An address which can be used for removing a scheduled task.
fn schedule(
when: DispatchTime<T::BlockNumber>,
maybe_periodic: Option<Period<T::BlockNumber>>,
priority: Priority,
origin: T::PalletsOrigin,
call: <T as Config>::Call
) -> Result<Self::Address, DispatchError>
fn schedule(
when: DispatchTime<T::BlockNumber>,
maybe_periodic: Option<Period<T::BlockNumber>>,
priority: Priority,
origin: T::PalletsOrigin,
call: <T as Config>::Call
) -> Result<Self::Address, DispatchError>
Schedule a dispatch to happen at the beginning of some block in the future. Read more
Cancel a scheduled task. If periodic, then it will cancel all further instances of that, also. Read more
fn reschedule(
address: Self::Address,
when: DispatchTime<T::BlockNumber>
) -> Result<Self::Address, DispatchError>
fn reschedule(
address: Self::Address,
when: DispatchTime<T::BlockNumber>
) -> 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
Return the next dispatch time for a given task. Read more
Get the benchmarks available for this pallet. Generally there is one benchmark per extrinsic, so these are sometimes just called “extrinsics”. Read more
fn run_benchmark(
extrinsic: &[u8],
c: &[(BenchmarkParameter, u32)],
whitelist: &[TrackedStorageKey],
verify: bool,
internal_repeats: u32
) -> Result<Vec<BenchmarkResults>, &'static str>
fn run_benchmark(
extrinsic: &[u8],
c: &[(BenchmarkParameter, u32)],
whitelist: &[TrackedStorageKey],
verify: bool,
internal_repeats: u32
) -> Result<Vec<BenchmarkResults>, &'static str>
Run the benchmarks for this pallet.
Returns the current storage version as supported by the pallet.
Returns the on-chain storage version of the pallet as stored in the storage.
The block is being finalized. Implement to have something happen.
This will be run when the block is being finalized (before on_finalize
).
Implement to have something happen using the remaining weight.
Will not fire if the remaining weight is 0.
Return the weight used, the hook will subtract it from current weight used
and pass the result to the next on_idle
hook if it exists. Read more
Perform a module upgrade. Read more
Execute some pre-checks prior to a runtime upgrade. Read more
Execute some post-checks after a runtime upgrade. Read more
Implementing this function on a module allows you to perform long-running tasks that make (by default) validators generate transactions that feed results of those long-running computations back on chain. Read more
Run integrity test. Read more
Run integrity test. Read more
impl<T: Config> Named<<T as Config>::BlockNumber, <T as Config>::Call, <T as Config>::PalletsOrigin> for Pallet<T>
impl<T: Config> Named<<T as Config>::BlockNumber, <T as Config>::Call, <T as Config>::PalletsOrigin> for Pallet<T>
type Address = TaskAddress<T::BlockNumber>
type Address = TaskAddress<T::BlockNumber>
An address which can be used for removing a scheduled task.
fn schedule_named(
id: Vec<u8>,
when: DispatchTime<T::BlockNumber>,
maybe_periodic: Option<Period<T::BlockNumber>>,
priority: Priority,
origin: T::PalletsOrigin,
call: <T as Config>::Call
) -> Result<Self::Address, ()>
fn schedule_named(
id: Vec<u8>,
when: DispatchTime<T::BlockNumber>,
maybe_periodic: Option<Period<T::BlockNumber>>,
priority: Priority,
origin: T::PalletsOrigin,
call: <T as Config>::Call
) -> Result<Self::Address, ()>
Schedule a dispatch to happen at the beginning of some block in the future. Read more
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<T::BlockNumber>
) -> Result<Self::Address, DispatchError>
fn reschedule_named(
id: Vec<u8>,
when: DispatchTime<T::BlockNumber>
) -> 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
Return the next dispatch time for a given task. Read more
This function is being called after every block import (when fully synced). Read more
The block is being finalized. Implement to have something happen. Read more
Something that should happen at genesis.
The block is being finalized.
Implement to have something happen in case there is leftover weight.
Check the passed remaining_weight
to make sure it is high enough to allow for
your pallet’s extra computation. Read more
The block is being initialized. Implement to have something happen. Read more
Auto Trait Implementations
impl<T> RefUnwindSafe for Pallet<T> where
T: RefUnwindSafe,
impl<T> UnwindSafe for Pallet<T> where
T: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
impl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: Any,
Convert Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
. Read more
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read more
Convert &Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read more
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert &mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
Generate a storage key unique to this runtime upgrade. Read more
Get temporary storage data written by Self::set_temp_storage
. Read more
Write some temporary data to a specific storage that can be read (potentially in
post-upgrade hook) via Self::get_temp_storage
. Read more
impl<T> PalletVersionToStorageVersionHelper for T where
T: GetStorageVersion + PalletInfoAccess,
impl<T> PalletVersionToStorageVersionHelper for T where
T: GetStorageVersion + PalletInfoAccess,
type Output = T
type Output = T
Should always be Self
The inverse inclusion map: attempts to construct self
from the equivalent element of its
superset. Read more
pub fn is_in_subset(&self) -> bool
pub fn is_in_subset(&self) -> bool
Checks if self
is actually part of its subset T
(and can be converted to it).
pub fn to_subset_unchecked(&self) -> SS
pub fn to_subset_unchecked(&self) -> SS
Use with care! Same as self.to_subset
but without any property checks. Always succeeds.
pub fn from_subset(element: &SS) -> SP
pub fn from_subset(element: &SS) -> SP
The inclusion map: converts self
to the equivalent element of its superset.
The counterpart to unchecked_from
.
Consume self to return an equivalent value of T
.
pub fn vzip(self) -> V
impl<T> MaybeDebug for T where
T: Debug,
impl<T> MaybeDebug for T where
T: Debug,