pub enum CacheStrategy {
None,
Auto,
Anthropic,
Google {
ttl: Duration,
},
}Expand description
Provider-agnostic caching configuration.
Adapters translate this to provider-specific cache markers at request construction time. Adapters that don’t support caching silently ignore the strategy.
Variants§
None
No caching (default) — no cache markers injected.
Auto
Adapter determines optimal cache points (e.g., system prompt + tool definitions for Anthropic, long context for Google).
Anthropic
Anthropic-specific: inject cache_control: { type: "ephemeral" }
blocks on system prompt and tool definitions.
Google-specific: reference a CachedContent resource with the given TTL.
Trait Implementations§
Source§impl Clone for CacheStrategy
impl Clone for CacheStrategy
Source§fn clone(&self) -> CacheStrategy
fn clone(&self) -> CacheStrategy
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 CacheStrategy
impl Debug for CacheStrategy
Source§impl Default for CacheStrategy
impl Default for CacheStrategy
Source§fn default() -> CacheStrategy
fn default() -> CacheStrategy
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for CacheStrategy
impl RefUnwindSafe for CacheStrategy
impl Send for CacheStrategy
impl Sync for CacheStrategy
impl Unpin for CacheStrategy
impl UnsafeUnpin for CacheStrategy
impl UnwindSafe for CacheStrategy
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