referrerpolicy=no-referrer-when-downgrade

Trait frame_support::traits::schedule::v1::Anon

source ยท
pub trait Anon<BlockNumber, Call, RuntimeOrigin> {
    type Address: Codec + Clone + Eq + EncodeLike + Debug + TypeInfo + MaxEncodedLen;

    // Required methods
    fn schedule(
        when: DispatchTime<BlockNumber>,
        maybe_periodic: Option<Period<BlockNumber>>,
        priority: Priority,
        origin: RuntimeOrigin,
        call: Call,
    ) -> Result<Self::Address, DispatchError>;
    fn cancel(address: Self::Address) -> Result<(), ()>;
    fn reschedule(
        address: Self::Address,
        when: DispatchTime<BlockNumber>,
    ) -> Result<Self::Address, DispatchError>;
    fn next_dispatch_time(address: Self::Address) -> Result<BlockNumber, ()>;
}
๐Ÿ‘ŽDeprecated: Use v3 instead. Will be removed after September 2024.
Expand description

A type that can be used as a scheduler.

Required Associated Typesยง

source

type Address: Codec + Clone + Eq + EncodeLike + Debug + TypeInfo + MaxEncodedLen

๐Ÿ‘ŽDeprecated: Use v3 instead. Will be removed after September 2024.

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

Required Methodsยง

source

fn schedule( when: DispatchTime<BlockNumber>, maybe_periodic: Option<Period<BlockNumber>>, priority: Priority, origin: RuntimeOrigin, call: Call, ) -> 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.

This is not named.

source

fn cancel(address: 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.

Will return an error if the address is invalid.

NOTE: This guaranteed to work only before the point that it is due to be executed. If it ends up being delayed beyond the point of execution, then it cannot be cancelled.

NOTE2: This will not work to cancel periodic tasks after their initial execution. For that, you must name the task explicitly using the Named trait.

source

fn reschedule( address: Self::Address, when: DispatchTime<BlockNumber>, ) -> 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.

Will return an error if the address is invalid.

source

fn next_dispatch_time(address: Self::Address) -> Result<BlockNumber, ()>

๐Ÿ‘ŽDeprecated: Use v3 instead. Will be removed after September 2024.

Return the next dispatch time for a given task.

Will return an error if the address is invalid.

Object Safetyยง

This trait is not object safe.

Implementorsยง

sourceยง

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