pub struct AnthropicPromptCacheSettings {
pub enabled: bool,
pub default_ttl_seconds: u64,
pub extended_ttl_seconds: Option<u64>,
pub max_breakpoints: u8,
pub cache_system_messages: bool,
pub cache_user_messages: bool,
}Expand description
Anthropic Claude cache control settings
Fields§
§enabled: bool§default_ttl_seconds: u64Default TTL in seconds (maps to “5m” in API). Default: 300 seconds (5 minutes) Note: Anthropic only supports “5m” or “1h” TTL formats.
extended_ttl_seconds: Option<u64>Optional extended TTL in seconds (maps to “1h” in API if >= 3600). Set to 3600 or higher to use 1-hour caching. Set to None or < 3600 to use default 5-minute caching. Default: Some(3600) for 1-hour caching Note: Using 1h requires the “extended-cache-ttl-2025-04-11” beta header.
max_breakpoints: u8Maximum number of cache breakpoints to use (max 4 per Anthropic spec). Default: 4
cache_system_messages: boolApply cache control to system prompts by default
cache_user_messages: boolApply cache control to user messages exceeding threshold
Trait Implementations§
Source§impl Clone for AnthropicPromptCacheSettings
impl Clone for AnthropicPromptCacheSettings
Source§fn clone(&self) -> AnthropicPromptCacheSettings
fn clone(&self) -> AnthropicPromptCacheSettings
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 AnthropicPromptCacheSettings
impl Debug for AnthropicPromptCacheSettings
Source§impl<'de> Deserialize<'de> for AnthropicPromptCacheSettings
impl<'de> Deserialize<'de> for AnthropicPromptCacheSettings
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 JsonSchema for AnthropicPromptCacheSettings
impl JsonSchema for AnthropicPromptCacheSettings
Source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref keyword. Read moreAuto Trait Implementations§
impl Freeze for AnthropicPromptCacheSettings
impl RefUnwindSafe for AnthropicPromptCacheSettings
impl Send for AnthropicPromptCacheSettings
impl Sync for AnthropicPromptCacheSettings
impl Unpin for AnthropicPromptCacheSettings
impl UnwindSafe for AnthropicPromptCacheSettings
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