pub struct SubAgentCache { /* private fields */ }Expand description
Shared sub-agent result cache.
Wrapped in Arc<Mutex<>> so parent and parallel sub-agents can share it.
Implementations§
Source§impl SubAgentCache
impl SubAgentCache
Sourcepub fn get(&self, agent_name: &str, prompt: &str) -> Option<String>
pub fn get(&self, agent_name: &str, prompt: &str) -> Option<String>
Look up a cached result for the given agent + prompt.
Returns Some(response) on cache hit (and generation is current),
None on miss or stale entry.
Sourcepub fn put(&self, agent_name: &str, prompt: &str, response: &str)
pub fn put(&self, agent_name: &str, prompt: &str, response: &str)
Store a sub-agent result in the cache.
Sourcepub fn invalidate(&self)
pub fn invalidate(&self)
Invalidate all cache entries by bumping the generation counter.
Call this when any file mutation occurs (Write, Edit, Delete, Bash) to ensure stale sub-agent results aren’t reused.
Trait Implementations§
Source§impl Clone for SubAgentCache
impl Clone for SubAgentCache
Source§fn clone(&self) -> SubAgentCache
fn clone(&self) -> SubAgentCache
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SubAgentCache
impl Debug for SubAgentCache
Auto Trait Implementations§
impl Freeze for SubAgentCache
impl RefUnwindSafe for SubAgentCache
impl Send for SubAgentCache
impl Sync for SubAgentCache
impl Unpin for SubAgentCache
impl UnsafeUnpin for SubAgentCache
impl UnwindSafe for SubAgentCache
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more