pub trait TasksFacade<'a, T: Task<'a>>: Serialize + Deserialize<'a> {
// Required methods
fn new(name: String, desired_retention: f64) -> Self;
fn get_name(&self) -> &str;
fn get_desired_retention(&self) -> f64;
fn set_desired_retention(&mut self, desired_retention: f64);
fn tasks_total(&self) -> usize;
fn tasks_to_complete(&self) -> usize;
fn complete_task(
&mut self,
interaction: &mut impl FnMut(TaskId, Blocks) -> Result<Response>,
) -> Result<(), Error>;
fn insert(&mut self, task: T);
fn create_task(&mut self, input: BlocksWithAnswer);
fn iter<'t>(&'t self) -> impl Iterator<Item = (&'t T, TaskId)>
where T: 't;
fn remove(&mut self, id: TaskId) -> bool;
}
Required Methods§
fn new(name: String, desired_retention: f64) -> Self
fn get_name(&self) -> &str
fn get_desired_retention(&self) -> f64
fn set_desired_retention(&mut self, desired_retention: f64)
fn tasks_total(&self) -> usize
fn tasks_to_complete(&self) -> usize
Sourcefn complete_task(
&mut self,
interaction: &mut impl FnMut(TaskId, Blocks) -> Result<Response>,
) -> Result<(), Error>
fn complete_task( &mut self, interaction: &mut impl FnMut(TaskId, Blocks) -> Result<Response>, ) -> Result<(), Error>
fn insert(&mut self, task: T)
fn create_task(&mut self, input: BlocksWithAnswer)
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.