pub trait TasksCollection<'c> {
type Context: 'c;
type Target: Send + 'static;
type Executor: TaskExecutor + Default;
// Required methods
fn name() -> &'static str;
fn handle(context: Self::Context) -> Handler<'c, Self::Target>;
}Expand description
Describes the collection of tasks.
struct SimpleCollection;
impl<'c> TasksCollection<'c> for SimpleCollection {
type Context = ();
type Target = String;
type Executor = executors::Linear;
fn name() -> &'static str {
"Simple collection"
}
fn handle(context: Self::Context) -> Handler<'c, Self::Target> {
Handler::new(|result| println!("Received a value! {result}"))
}
}Required Associated Types§
Sourcetype Executor: TaskExecutor + Default
type Executor: TaskExecutor + Default
Executor that is used to control the execution process for this collection.
Required Methods§
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.