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, u128)>
where T: 't;
fn remove(&mut self, id: u128) -> bool;
}
Required Methods§
fn new(name: String) -> Self
fn get_name(&self) -> &str
fn tasks_total(&self) -> usize
fn tasks_to_complete(&self) -> usize
sourcefn complete_task(
&mut self,
interaction: &mut impl FnMut(Blocks) -> Result<Response>,
) -> Result<(), Error>
fn complete_task( &mut self, interaction: &mut impl FnMut(Blocks) -> Result<Response>, ) -> Result<(), Error>
If an error occurs, the tasks facade will remain unmodified.
fn insert(&mut self, task: T)
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.