pub trait Task: Sized {
// Required methods
fn from_description(
task_type: impl AsRef<str>,
description: impl AsRef<str>,
) -> Result<Self>;
fn task_type(&self) -> &str;
fn to_description(&self) -> String;
fn task_id(&self) -> Uuid;
}
Expand description
Base trait for representing tasks in the delegation
Required Methods§
Sourcefn from_description(
task_type: impl AsRef<str>,
description: impl AsRef<str>,
) -> Result<Self>
fn from_description( task_type: impl AsRef<str>, description: impl AsRef<str>, ) -> Result<Self>
Create a task from a text description (aka json string…)
Sourcefn to_description(&self) -> String
fn to_description(&self) -> String
Convert into a string representation
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.