pub struct TaskContextHandle { /* private fields */ }Expand description
Capability-specific mutable handle for task-manager state.
Implementations§
Source§impl TaskContextHandle
impl TaskContextHandle
Sourcepub fn from_context(context: &AgentContext) -> Self
pub fn from_context(context: &AgentContext) -> Self
Create a narrow task handle from current context values.
Sourcepub fn update<R>(
&self,
update: impl FnOnce(&mut TaskManager) -> R,
) -> (R, Vec<Task>)
pub fn update<R>( &self, update: impl FnOnce(&mut TaskManager) -> R, ) -> (R, Vec<Task>)
Mutate only the task manager and return its latest snapshot.
Sourcepub fn apply_to(&self, context: &mut AgentContext)
pub fn apply_to(&self, context: &mut AgentContext)
Apply the isolated task state and publish its durable snapshot to a context.
Trait Implementations§
Source§impl Clone for TaskContextHandle
impl Clone for TaskContextHandle
Source§fn clone(&self) -> TaskContextHandle
fn clone(&self) -> TaskContextHandle
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for TaskContextHandle
impl RefUnwindSafe for TaskContextHandle
impl Send for TaskContextHandle
impl Sync for TaskContextHandle
impl Unpin for TaskContextHandle
impl UnsafeUnpin for TaskContextHandle
impl UnwindSafe for TaskContextHandle
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