pub struct TaskDef {
pub name: String,
pub task_fn: Box<dyn FnMut(&TaskContext) -> Result<TaskOutput, FabricError>>,
pub resource_req: ResourceReq,
pub inputs: Vec<DataRef>,
pub outputs: Vec<DataRef>,
pub retries: u32,
}Expand description
Definition of a task within the graph.
The task_fn closure uses FnMut so it can be retried on failure.
For tasks with retries > 0, the closure is called again with the
same TaskContext on each retry attempt.
Fields§
§name: StringHuman-readable task name.
task_fn: Box<dyn FnMut(&TaskContext) -> Result<TaskOutput, FabricError>>The function to execute. Called with a TaskContext on each
attempt (initial + retries).
resource_req: ResourceReqResource requirements.
inputs: Vec<DataRef>Named data inputs this task consumes.
outputs: Vec<DataRef>Named data outputs this task produces.
retries: u32Number of retry attempts on failure (0 = no retries).
Auto Trait Implementations§
impl Freeze for TaskDef
impl !RefUnwindSafe for TaskDef
impl !Send for TaskDef
impl !Sync for TaskDef
impl Unpin for TaskDef
impl !UnwindSafe for TaskDef
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more