pub struct DagContext { /* private fields */ }Expand description
Shared state accessible to all tasks during DAG execution.
Tasks use DagContext to:
- Read outputs from predecessor tasks (
get_output) - Write their own outputs for dependent tasks (
set_output) - Access user-provided state like configuration (
get_state/set_state)
Implementations§
Source§impl DagContext
impl DagContext
Sourcepub fn get_output<T: Clone + 'static>(&self, id: &TaskId) -> Option<T>
pub fn get_output<T: Clone + 'static>(&self, id: &TaskId) -> Option<T>
Get a task’s output, downcasting to the expected type.
Sourcepub fn set_output<T: Send + 'static>(&self, id: TaskId, value: T)
pub fn set_output<T: Send + 'static>(&self, id: TaskId, value: T)
Store a task’s output.
Sourcepub fn has_output(&self, id: &TaskId) -> bool
pub fn has_output(&self, id: &TaskId) -> bool
Check if a task has produced output.
Trait Implementations§
Source§impl Clone for DagContext
impl Clone for DagContext
Auto Trait Implementations§
impl Freeze for DagContext
impl RefUnwindSafe for DagContext
impl Send for DagContext
impl Sync for DagContext
impl Unpin for DagContext
impl UnsafeUnpin for DagContext
impl UnwindSafe for DagContext
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