referrerpolicy=no-referrer-when-downgrade

Trait frame_support::traits::schedule::v2::Named

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

    // Required methods
    fn schedule_named(
        id: Vec<u8>,
        when: DispatchTime<BlockNumber>,
        maybe_periodic: Option<Period<BlockNumber>>,
        priority: Priority,
        origin: RuntimeOrigin,
        call: MaybeHashed<Call, Self::Hash>,
    ) -> Result<Self::Address, ()>;
    fn cancel_named(id: Vec<u8>) -> Result<(), ()>;
    fn reschedule_named(
        id: Vec<u8>,
        when: DispatchTime<BlockNumber>,
    ) -> Result<Self::Address, DispatchError>;
    fn next_dispatch_time(id: Vec<u8>) -> 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 + MaxEncodedLen

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

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

source

type Hash

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

A means of expressing a call by the hash of its encoded data.

Required Methodsยง

source

fn schedule_named( id: Vec<u8>, when: DispatchTime<BlockNumber>, maybe_periodic: Option<Period<BlockNumber>>, priority: Priority, origin: RuntimeOrigin, call: MaybeHashed<Call, Self::Hash>, ) -> 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.

  • id: The identity of the task. This must be unique and will return an error if not.
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.

Will return an error if the id 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.

source

fn reschedule_named( id: Vec<u8>, 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.

source

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.

Will return an error if the id is invalid.

Object Safetyยง

This trait is not object safe.

Implementorsยง