pub struct ToolResultCache { /* private fields */ }Expand description
Thread-safe cache of compressed tool results for one proxy session.
Implementations§
Source§impl ToolResultCache
impl ToolResultCache
pub fn new() -> Self
Sourcepub fn check(&self, tool_name: &str, content: &str) -> Option<DedupHit>
pub fn check(&self, tool_name: &str, content: &str) -> Option<DedupHit>
Check whether this exact content was already compressed in this session.
Sourcepub fn insert(
&self,
tool_name: &str,
content: &str,
token_count: usize,
ccr_handle: Option<String>,
)
pub fn insert( &self, tool_name: &str, content: &str, token_count: usize, ccr_handle: Option<String>, )
Insert a tool result after compression.
Sourcepub fn advance_turn(&self)
pub fn advance_turn(&self)
Advance the session’s API-request turn counter.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for ToolResultCache
impl !RefUnwindSafe for ToolResultCache
impl Send for ToolResultCache
impl Sync for ToolResultCache
impl Unpin for ToolResultCache
impl UnsafeUnpin for ToolResultCache
impl UnwindSafe for ToolResultCache
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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