pub enum CacheTtl {
Ephemeral,
OneHour,
}Expand description
Prompt-cache TTL variant for the Anthropic API.
When used as a TOML config value the accepted strings are "ephemeral" and "1h".
On the wire (Anthropic API), OneHour serializes as "1h" inside the cache_control.ttl
field.
Variants§
Ephemeral
Default ephemeral TTL (~5 minutes). No beta header required.
OneHour
Extended 1-hour TTL. Requires the extended-cache-ttl-2025-04-25 beta header.
Cache writes cost approximately 2× more than Ephemeral.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for CacheTtl
impl<'de> Deserialize<'de> for CacheTtl
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
impl Copy for CacheTtl
impl Eq for CacheTtl
impl StructuralPartialEq for CacheTtl
Auto Trait Implementations§
impl Freeze for CacheTtl
impl RefUnwindSafe for CacheTtl
impl Send for CacheTtl
impl Sync for CacheTtl
impl Unpin for CacheTtl
impl UnsafeUnpin for CacheTtl
impl UnwindSafe for CacheTtl
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.