Enum pallet_scheduler::pallet::Call
source · pub enum Call<T: Config> {
schedule {
when: BlockNumberFor<T>,
maybe_periodic: Option<Period<BlockNumberFor<T>>>,
priority: Priority,
call: Box<<T as Config>::RuntimeCall>,
},
cancel {
when: BlockNumberFor<T>,
index: u32,
},
schedule_named {
id: TaskName,
when: BlockNumberFor<T>,
maybe_periodic: Option<Period<BlockNumberFor<T>>>,
priority: Priority,
call: Box<<T as Config>::RuntimeCall>,
},
cancel_named {
id: TaskName,
},
schedule_after {
after: BlockNumberFor<T>,
maybe_periodic: Option<Period<BlockNumberFor<T>>>,
priority: Priority,
call: Box<<T as Config>::RuntimeCall>,
},
schedule_named_after {
id: TaskName,
after: BlockNumberFor<T>,
maybe_periodic: Option<Period<BlockNumberFor<T>>>,
priority: Priority,
call: Box<<T as Config>::RuntimeCall>,
},
set_retry {
task: TaskAddress<BlockNumberFor<T>>,
retries: u8,
period: BlockNumberFor<T>,
},
set_retry_named {
id: TaskName,
retries: u8,
period: BlockNumberFor<T>,
},
cancel_retry {
task: TaskAddress<BlockNumberFor<T>>,
},
cancel_retry_named {
id: TaskName,
},
// some variants omitted
}
Expand description
Contains a variant per dispatchable extrinsic that this pallet has.
Variants§
schedule
Anonymously schedule a task.
cancel
Cancel an anonymously scheduled task.
schedule_named
Fields
id: TaskName
when: BlockNumberFor<T>
priority: Priority
call: Box<<T as Config>::RuntimeCall>
Schedule a named task.
cancel_named
Fields
id: TaskName
Cancel a named scheduled task.
schedule_after
Anonymously schedule a task after a delay.
schedule_named_after
Fields
id: TaskName
after: BlockNumberFor<T>
priority: Priority
call: Box<<T as Config>::RuntimeCall>
Schedule a named task after a delay.
set_retry
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
.
set_retry_named
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
.
cancel_retry
Fields
task: TaskAddress<BlockNumberFor<T>>
Removes the retry configuration of a task.
cancel_retry_named
Fields
id: TaskName
Cancel the retry configuration of a named task.
Implementations§
source§impl<T: Config> Call<T>
impl<T: Config> Call<T>
sourcepub fn new_call_variant_schedule(
when: BlockNumberFor<T>,
maybe_periodic: Option<Period<BlockNumberFor<T>>>,
priority: Priority,
call: Box<<T as Config>::RuntimeCall>
) -> Self
pub fn new_call_variant_schedule( when: BlockNumberFor<T>, maybe_periodic: Option<Period<BlockNumberFor<T>>>, priority: Priority, call: Box<<T as Config>::RuntimeCall> ) -> Self
Create a call with the variant schedule
.
sourcepub fn new_call_variant_cancel(when: BlockNumberFor<T>, index: u32) -> Self
pub fn new_call_variant_cancel(when: BlockNumberFor<T>, index: u32) -> Self
Create a call with the variant cancel
.
sourcepub fn new_call_variant_schedule_named(
id: TaskName,
when: BlockNumberFor<T>,
maybe_periodic: Option<Period<BlockNumberFor<T>>>,
priority: Priority,
call: Box<<T as Config>::RuntimeCall>
) -> Self
pub fn new_call_variant_schedule_named( id: TaskName, when: BlockNumberFor<T>, maybe_periodic: Option<Period<BlockNumberFor<T>>>, priority: Priority, call: Box<<T as Config>::RuntimeCall> ) -> Self
Create a call with the variant schedule_named
.
sourcepub fn new_call_variant_cancel_named(id: TaskName) -> Self
pub fn new_call_variant_cancel_named(id: TaskName) -> Self
Create a call with the variant cancel_named
.
sourcepub fn new_call_variant_schedule_after(
after: BlockNumberFor<T>,
maybe_periodic: Option<Period<BlockNumberFor<T>>>,
priority: Priority,
call: Box<<T as Config>::RuntimeCall>
) -> Self
pub fn new_call_variant_schedule_after( after: BlockNumberFor<T>, maybe_periodic: Option<Period<BlockNumberFor<T>>>, priority: Priority, call: Box<<T as Config>::RuntimeCall> ) -> Self
Create a call with the variant schedule_after
.
sourcepub fn new_call_variant_schedule_named_after(
id: TaskName,
after: BlockNumberFor<T>,
maybe_periodic: Option<Period<BlockNumberFor<T>>>,
priority: Priority,
call: Box<<T as Config>::RuntimeCall>
) -> Self
pub fn new_call_variant_schedule_named_after( id: TaskName, after: BlockNumberFor<T>, maybe_periodic: Option<Period<BlockNumberFor<T>>>, priority: Priority, call: Box<<T as Config>::RuntimeCall> ) -> Self
Create a call with the variant schedule_named_after
.
sourcepub fn new_call_variant_set_retry(
task: TaskAddress<BlockNumberFor<T>>,
retries: u8,
period: BlockNumberFor<T>
) -> Self
pub fn new_call_variant_set_retry( task: TaskAddress<BlockNumberFor<T>>, retries: u8, period: BlockNumberFor<T> ) -> Self
Create a call with the variant set_retry
.
sourcepub fn new_call_variant_set_retry_named(
id: TaskName,
retries: u8,
period: BlockNumberFor<T>
) -> Self
pub fn new_call_variant_set_retry_named( id: TaskName, retries: u8, period: BlockNumberFor<T> ) -> Self
Create a call with the variant set_retry_named
.
sourcepub fn new_call_variant_cancel_retry(
task: TaskAddress<BlockNumberFor<T>>
) -> Self
pub fn new_call_variant_cancel_retry( task: TaskAddress<BlockNumberFor<T>> ) -> Self
Create a call with the variant cancel_retry
.
sourcepub fn new_call_variant_cancel_retry_named(id: TaskName) -> Self
pub fn new_call_variant_cancel_retry_named(id: TaskName) -> Self
Create a call with the variant cancel_retry_named
.
Trait Implementations§
source§impl<T: Config> CheckIfFeeless for Call<T>
impl<T: Config> CheckIfFeeless for Call<T>
source§fn is_feeless(&self, origin: &Self::Origin) -> bool
fn is_feeless(&self, origin: &Self::Origin) -> bool
#[pallet::feeless_if]
source§impl<T: Config> Decode for Call<T>
impl<T: Config> Decode for Call<T>
source§fn decode<__CodecInputEdqy: Input>(
__codec_input_edqy: &mut __CodecInputEdqy
) -> Result<Self, Error>
fn decode<__CodecInputEdqy: Input>( __codec_input_edqy: &mut __CodecInputEdqy ) -> Result<Self, Error>
§fn decode_into<I>(
input: &mut I,
dst: &mut MaybeUninit<Self>
) -> Result<DecodeFinished, Error>where
I: Input,
fn decode_into<I>(
input: &mut I,
dst: &mut MaybeUninit<Self>
) -> Result<DecodeFinished, Error>where
I: Input,
§fn skip<I>(input: &mut I) -> Result<(), Error>where
I: Input,
fn skip<I>(input: &mut I) -> Result<(), Error>where
I: Input,
§fn encoded_fixed_size() -> Option<usize>
fn encoded_fixed_size() -> Option<usize>
source§impl<T: Config> Encode for Call<T>
impl<T: Config> Encode for Call<T>
source§fn size_hint(&self) -> usize
fn size_hint(&self) -> usize
source§fn encode_to<__CodecOutputEdqy: Output + ?Sized>(
&self,
__codec_dest_edqy: &mut __CodecOutputEdqy
)
fn encode_to<__CodecOutputEdqy: Output + ?Sized>( &self, __codec_dest_edqy: &mut __CodecOutputEdqy )
§fn using_encoded<R, F>(&self, f: F) -> R
fn using_encoded<R, F>(&self, f: F) -> R
§fn encoded_size(&self) -> usize
fn encoded_size(&self) -> usize
source§impl<T: Config> GetCallIndex for Call<T>
impl<T: Config> GetCallIndex for Call<T>
source§fn get_call_index(&self) -> u8
fn get_call_index(&self) -> u8
source§fn get_call_indices() -> &'static [u8] ⓘ
fn get_call_indices() -> &'static [u8] ⓘ
GetCallName
].source§impl<T: Config> GetCallName for Call<T>
impl<T: Config> GetCallName for Call<T>
source§fn get_call_name(&self) -> &'static str
fn get_call_name(&self) -> &'static str
source§fn get_call_names() -> &'static [&'static str]
fn get_call_names() -> &'static [&'static str]
GetCallIndex
].source§impl<T: Config> GetDispatchInfo for Call<T>
impl<T: Config> GetDispatchInfo for Call<T>
source§fn get_dispatch_info(&self) -> DispatchInfo
fn get_dispatch_info(&self) -> DispatchInfo
DispatchInfo
, containing relevant information of this dispatch. Read moresource§impl<T: Config> PartialEq for Call<T>
impl<T: Config> PartialEq for Call<T>
source§impl<T> TypeInfo for Call<T>where
PhantomData<(T,)>: TypeInfo + 'static,
BlockNumberFor<T>: TypeInfo + 'static,
Option<Period<BlockNumberFor<T>>>: TypeInfo + 'static,
Box<<T as Config>::RuntimeCall>: TypeInfo + 'static,
TaskAddress<BlockNumberFor<T>>: TypeInfo + 'static,
T: Config + 'static,
impl<T> TypeInfo for Call<T>where
PhantomData<(T,)>: TypeInfo + 'static,
BlockNumberFor<T>: TypeInfo + 'static,
Option<Period<BlockNumberFor<T>>>: TypeInfo + 'static,
Box<<T as Config>::RuntimeCall>: TypeInfo + 'static,
TaskAddress<BlockNumberFor<T>>: TypeInfo + 'static,
T: Config + 'static,
source§impl<T: Config> UnfilteredDispatchable for Call<T>
impl<T: Config> UnfilteredDispatchable for Call<T>
§type RuntimeOrigin = <T as Config>::RuntimeOrigin
type RuntimeOrigin = <T as Config>::RuntimeOrigin
frame_system::Config::RuntimeOrigin
).source§fn dispatch_bypass_filter(
self,
origin: Self::RuntimeOrigin
) -> DispatchResultWithPostInfo
fn dispatch_bypass_filter( self, origin: Self::RuntimeOrigin ) -> DispatchResultWithPostInfo
impl<T: Config> EncodeLike for Call<T>
impl<T: Config> Eq for Call<T>
Auto Trait Implementations§
impl<T> Freeze for Call<T>where
<<<T as Config>::Block as Block>::Header as Header>::Number: Freeze,
impl<T> RefUnwindSafe for Call<T>where
T: RefUnwindSafe,
<<<T as Config>::Block as Block>::Header as Header>::Number: RefUnwindSafe,
<T as Config>::RuntimeCall: RefUnwindSafe,
impl<T> Send for Call<T>
impl<T> Sync for Call<T>
impl<T> Unpin for Call<T>
impl<T> UnwindSafe for Call<T>where
T: UnwindSafe,
<<<T as Config>::Block as Block>::Header as Header>::Number: UnwindSafe,
<T as Config>::RuntimeCall: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CheckedConversion for T
impl<T> CheckedConversion for T
§fn checked_from<T>(t: T) -> Option<Self>where
Self: TryFrom<T>,
fn checked_from<T>(t: T) -> Option<Self>where
Self: TryFrom<T>,
§fn checked_into<T>(self) -> Option<T>where
Self: TryInto<T>,
fn checked_into<T>(self) -> Option<T>where
Self: TryInto<T>,
§impl<T> DecodeAll for Twhere
T: Decode,
impl<T> DecodeAll for Twhere
T: Decode,
§fn decode_all(input: &mut &[u8]) -> Result<T, Error>
fn decode_all(input: &mut &[u8]) -> Result<T, Error>
Self
and consume all of the given input data. Read more§impl<T> DecodeLimit for Twhere
T: Decode,
impl<T> DecodeLimit for Twhere
T: Decode,
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Hashable for Twhere
T: Codec,
impl<T> Hashable for Twhere
T: Codec,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<T> IsType<T> for T
impl<T> IsType<T> for T
§impl<T, Outer> IsWrappedBy<Outer> for T
impl<T, Outer> IsWrappedBy<Outer> for T
§impl<T> KeyedVec for Twhere
T: Codec,
impl<T> KeyedVec for Twhere
T: Codec,
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> SaturatedConversion for T
impl<T> SaturatedConversion for T
§fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
§fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
T
. Read more§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.§impl<T, U> TryIntoKey<U> for Twhere
U: TryFromKey<T>,
impl<T, U> TryIntoKey<U> for Twhere
U: TryFromKey<T>,
type Error = <U as TryFromKey<T>>::Error
fn try_into_key(self) -> Result<U, <U as TryFromKey<T>>::Error>
§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
unchecked_from
.§impl<T, S> UniqueSaturatedInto<T> for S
impl<T, S> UniqueSaturatedInto<T> for S
§fn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
T
.