Trait ssr_core::tasks_facade::TasksFacade

source ·
pub trait TasksFacade<'a, T: Task<'a>>: Serialize + Deserialize<'a> {
    // Required methods
    fn new(name: String) -> Self;
    fn get_name(&self) -> &str;
    fn tasks_total(&self) -> usize;
    fn tasks_to_complete(&self) -> usize;
    fn complete_task(
        &mut self,
        interaction: &mut impl FnMut(Blocks) -> Result<Response>,
    ) -> Result<(), Error>;
    fn insert(&mut self, task: T);
    fn iter<'t>(&'t self) -> impl Iterator<Item = &'t T>
       where T: 't;
    fn remove(&mut self, task: &T) -> bool;
}

Required Methods§

source

fn new(name: String) -> Self

source

fn get_name(&self) -> &str

source

fn tasks_total(&self) -> usize

source

fn tasks_to_complete(&self) -> usize

source

fn complete_task( &mut self, interaction: &mut impl FnMut(Blocks) -> Result<Response>, ) -> Result<(), Error>

If an error occurs, the tasks facade will remain unmodified.

source

fn insert(&mut self, task: T)

source

fn iter<'t>(&'t self) -> impl Iterator<Item = &'t T>
where T: 't,

source

fn remove(&mut self, task: &T) -> bool

Remove task. Returns whether such an element was present.

Object Safety§

This trait is not object safe.

Implementors§