pub trait SchedulerProviderTrait<Origin, BlockNumber, Call> {
// Required methods
fn schedule(
origin: Origin,
id: [u8; 32],
when: BlockNumber,
call: Box<Call>,
) -> Result<(), DispatchError>;
fn cancel(origin: Origin, id: [u8; 32]) -> Result<(), DispatchError>;
}
Expand description
A trait that defines a scheduler provider for scheduling calls to be executed at a specific block number.
Required Methods§
Sourcefn schedule(
origin: Origin,
id: [u8; 32],
when: BlockNumber,
call: Box<Call>,
) -> Result<(), DispatchError>
fn schedule( origin: Origin, id: [u8; 32], when: BlockNumber, call: Box<Call>, ) -> Result<(), DispatchError>
Schedules a call to be executed at a specified block number.
§Returns
Ok(())
if the call was successfully scheduled.Err(DispatchError)
if there was an error scheduling the call.
§Errors
This function may return a DispatchError
for various reasons, such as:
- Insufficient permissions or invalid origin.
- Invalid block number or scheduling conflicts.
- Other runtime-specific errors.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.