pub struct SchedulerCallApi<'api> { /* private fields */ }Implementations§
Source§impl<'api> SchedulerCallApi<'api>
impl<'api> SchedulerCallApi<'api>
Sourcepub fn schedule(
&self,
when: u32,
maybe_periodic: Option<(u32, u32)>,
priority: u8,
call: RuntimeCall,
) -> Result<WrappedCall>
pub fn schedule( &self, when: u32, maybe_periodic: Option<(u32, u32)>, priority: u8, call: RuntimeCall, ) -> Result<WrappedCall>
Anonymously schedule a task.
Sourcepub fn cancel(&self, when: u32, index: u32) -> Result<WrappedCall>
pub fn cancel(&self, when: u32, index: u32) -> Result<WrappedCall>
Cancel a scheduled task (named or anonymous), by providing the block it is scheduled for execution in, as well as the index of the task in that block’s agenda.
In the case of a named task, it will remove it from the lookup table as well.
Sourcepub fn schedule_named(
&self,
id: [u8; 32],
when: u32,
maybe_periodic: Option<(u32, u32)>,
priority: u8,
call: RuntimeCall,
) -> Result<WrappedCall>
pub fn schedule_named( &self, id: [u8; 32], when: u32, maybe_periodic: Option<(u32, u32)>, priority: u8, call: RuntimeCall, ) -> Result<WrappedCall>
Schedule a named task.
Sourcepub fn cancel_named(&self, id: [u8; 32]) -> Result<WrappedCall>
pub fn cancel_named(&self, id: [u8; 32]) -> Result<WrappedCall>
Cancel a named scheduled task.
Sourcepub fn schedule_after(
&self,
after: u32,
maybe_periodic: Option<(u32, u32)>,
priority: u8,
call: RuntimeCall,
) -> Result<WrappedCall>
pub fn schedule_after( &self, after: u32, maybe_periodic: Option<(u32, u32)>, priority: u8, call: RuntimeCall, ) -> Result<WrappedCall>
Anonymously schedule a task after a delay.
Sourcepub fn schedule_named_after(
&self,
id: [u8; 32],
after: u32,
maybe_periodic: Option<(u32, u32)>,
priority: u8,
call: RuntimeCall,
) -> Result<WrappedCall>
pub fn schedule_named_after( &self, id: [u8; 32], after: u32, maybe_periodic: Option<(u32, u32)>, priority: u8, call: RuntimeCall, ) -> Result<WrappedCall>
Schedule a named task after a delay.
Sourcepub fn set_retry(
&self,
task: (u32, u32),
retries: u8,
period: u32,
) -> Result<WrappedCall>
pub fn set_retry( &self, task: (u32, u32), retries: u8, period: u32, ) -> Result<WrappedCall>
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.
This call cannot be used to set a retry configuration for a named task.
Sourcepub fn set_retry_named(
&self,
id: [u8; 32],
retries: u8,
period: u32,
) -> Result<WrappedCall>
pub fn set_retry_named( &self, id: [u8; 32], retries: u8, period: u32, ) -> Result<WrappedCall>
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.
This is the only way to set a retry configuration for a named task.
Sourcepub fn cancel_retry(&self, task: (u32, u32)) -> Result<WrappedCall>
pub fn cancel_retry(&self, task: (u32, u32)) -> Result<WrappedCall>
Removes the retry configuration of a task.
Sourcepub fn cancel_retry_named(&self, id: [u8; 32]) -> Result<WrappedCall>
pub fn cancel_retry_named(&self, id: [u8; 32]) -> Result<WrappedCall>
Cancel the retry configuration of a named task.
Trait Implementations§
Source§impl<'api> Clone for SchedulerCallApi<'api>
impl<'api> Clone for SchedulerCallApi<'api>
Source§fn clone(&self) -> SchedulerCallApi<'api>
fn clone(&self) -> SchedulerCallApi<'api>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl<'api> Freeze for SchedulerCallApi<'api>
impl<'api> !RefUnwindSafe for SchedulerCallApi<'api>
impl<'api> Send for SchedulerCallApi<'api>
impl<'api> Sync for SchedulerCallApi<'api>
impl<'api> Unpin for SchedulerCallApi<'api>
impl<'api> UnsafeUnpin for SchedulerCallApi<'api>
impl<'api> !UnwindSafe for SchedulerCallApi<'api>
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
Source§impl<T> CheckedConversion for T
impl<T> CheckedConversion for T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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 moreSource§impl<Src, Dest> IntoTuple<Dest> for Srcwhere
Dest: FromTuple<Src>,
impl<Src, Dest> IntoTuple<Dest> for Srcwhere
Dest: FromTuple<Src>,
fn into_tuple(self) -> Dest
Source§impl<T, Outer> IsWrappedBy<Outer> for T
impl<T, Outer> IsWrappedBy<Outer> for T
Source§impl<T> SaturatedConversion for T
impl<T> SaturatedConversion for T
Source§fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
Source§fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
T. Read moreSource§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
Source§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
unchecked_from.Source§impl<T, S> UniqueSaturatedInto<T> for S
impl<T, S> UniqueSaturatedInto<T> for S
Source§fn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
T.