pub struct PromptCacheTelemetry { /* private fields */ }Expand description
Recorder threaded through every LLM dispatch by the executor. Lets the MCP tool surface and integration tests observe whether stages within a run share the cache key.
Implementations§
Source§impl PromptCacheTelemetry
impl PromptCacheTelemetry
Sourcepub fn record(&self, key: CacheKey)
pub fn record(&self, key: CacheKey)
Record a cache key (called by the executor before each LLM dispatch). A poisoned mutex is treated as “drop the record” rather than panic — telemetry should never wedge the dispatch.
Sourcepub fn snapshot(&self) -> Vec<CacheKey>
pub fn snapshot(&self) -> Vec<CacheKey>
Snapshot the recorded keys in observation order. Used by tests
- the MCP tool’s response trace.
Sourcepub fn all_keys_match(&self) -> bool
pub fn all_keys_match(&self) -> bool
true if every recorded key is identical. The Form 3
acceptance criterion: stages within a run must share the cache
key. With zero or one recordings the predicate trivially holds.
Trait Implementations§
Source§impl Debug for PromptCacheTelemetry
impl Debug for PromptCacheTelemetry
Source§impl Default for PromptCacheTelemetry
impl Default for PromptCacheTelemetry
Source§fn default() -> PromptCacheTelemetry
fn default() -> PromptCacheTelemetry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for PromptCacheTelemetry
impl RefUnwindSafe for PromptCacheTelemetry
impl Send for PromptCacheTelemetry
impl Sync for PromptCacheTelemetry
impl Unpin for PromptCacheTelemetry
impl UnsafeUnpin for PromptCacheTelemetry
impl UnwindSafe for PromptCacheTelemetry
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
impl<T> ErasedDestructor for Twhere
T: 'static,
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