ssr_core::task

Trait Task

source
pub trait Task<'a>: Serialize + Deserialize<'a> {
    type SharedState: SharedState<'a>;

    // Required methods
    fn next_repetition(&self, _retrievability_goal: f64) -> SystemTime;
    fn complete(
        &mut self,
        shared_state: &mut Self::SharedState,
        interaction: &mut impl FnMut(Blocks) -> Result<Response>,
    ) -> Result<()>;
}

Required Associated Types§

Required Methods§

source

fn next_repetition(&self, _retrievability_goal: f64) -> SystemTime

source

fn complete( &mut self, shared_state: &mut Self::SharedState, interaction: &mut impl FnMut(Blocks) -> Result<Response>, ) -> Result<()>

If an error occurs, the task will remain unmodified.

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.

Implementors§