pub enum CacheControl {
Ephemeral {
ttl: Option<String>,
},
}Expand description
Cache control configuration for content caching (Anthropic-style)
Used to mark specific content blocks, messages, or tools for caching. Anthropic allows up to 4 cache breakpoints per request.
§Example
use stakai::CacheControl;
// Default ephemeral cache (~5 min TTL)
let cache = CacheControl::ephemeral();
// Extended cache with 1-hour TTL
let cache = CacheControl::ephemeral_with_ttl("1h");Variants§
Ephemeral
Ephemeral cache that persists for a limited time
Default TTL is approximately 5 minutes. Use ttl to specify
a longer duration (e.g., “1h” for 1-hour cache on Anthropic).
Implementations§
Source§impl CacheControl
impl CacheControl
Trait Implementations§
Source§impl Clone for CacheControl
impl Clone for CacheControl
Source§fn clone(&self) -> CacheControl
fn clone(&self) -> CacheControl
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 CacheControl
impl Debug for CacheControl
Source§impl Default for CacheControl
impl Default for CacheControl
Source§impl<'de> Deserialize<'de> for CacheControl
impl<'de> Deserialize<'de> for CacheControl
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for CacheControl
impl PartialEq for CacheControl
Source§impl Serialize for CacheControl
impl Serialize for CacheControl
impl Eq for CacheControl
impl StructuralPartialEq for CacheControl
Auto Trait Implementations§
impl Freeze for CacheControl
impl RefUnwindSafe for CacheControl
impl Send for CacheControl
impl Sync for CacheControl
impl Unpin for CacheControl
impl UnwindSafe for CacheControl
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