pub trait ContinuallyRan: Sized + Send {
const DELAY_BETWEEN_ITERATIONS: u64 = 5u64;
const MAX_DELAY_BETWEEN_ITERATIONS: u64 = 120u64;
// Required method
fn run_iteration(
&mut self,
) -> impl Send + Future<Output = Result<bool, String>>;
// Provided method
fn continually_run(
self,
task: Task,
dependents: Vec<TaskHandle>,
) -> impl Send + Future<Output = ()> { ... }
}Expand description
A task to be continually ran.
Provided Associated Constants§
Sourceconst DELAY_BETWEEN_ITERATIONS: u64 = 5u64
const DELAY_BETWEEN_ITERATIONS: u64 = 5u64
The amount of seconds before this task should be polled again.
Sourceconst MAX_DELAY_BETWEEN_ITERATIONS: u64 = 120u64
const MAX_DELAY_BETWEEN_ITERATIONS: u64 = 120u64
The maximum amount of seconds before this task should be run again.
Upon error, the amount of time waited will be linearly increased until this limit.
Required Methods§
Provided Methods§
Sourcefn continually_run(
self,
task: Task,
dependents: Vec<TaskHandle>,
) -> impl Send + Future<Output = ()>
fn continually_run( self, task: Task, dependents: Vec<TaskHandle>, ) -> impl Send + Future<Output = ()>
Continually run the task.
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.