Skip to main content

DynTask

Trait DynTask 

Source
pub trait DynTask: Send + Sync {
    // Required methods
    fn task_id(&self) -> &TaskId;
    fn config(&self) -> &TaskConfig;
    fn execute(&self, args: &SerializedArguments) -> RustvelloResult<String>;
}
Expand description

Type-erased task interface for the TaskRegistry.

Every T: Task automatically implements DynTask via a blanket impl. The registry stores Arc<dyn DynTask>, which handles serialization and deserialization internally.

Required Methods§

Source

fn task_id(&self) -> &TaskId

The task’s unique identifier.

Source

fn config(&self) -> &TaskConfig

The task’s configuration.

Source

fn execute(&self, args: &SerializedArguments) -> RustvelloResult<String>

Execute with SerializedArguments, returns serialized JSON result.

Trait Implementations§

Source§

impl Debug for dyn DynTask

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Implementors§

Source§

impl<T: Task> DynTask for T