pub struct ClaudePromptCache {
pub ttl: ClaudePromptCacheTtl,
pub strategy: ClaudePromptCacheStrategy,
}Expand description
Claude prompt cache control for the Messages API.
Fields§
§ttl: ClaudePromptCacheTtlRequested cache TTL policy.
strategy: ClaudePromptCacheStrategyCache application strategy.
Implementations§
Source§impl ClaudePromptCache
impl ClaudePromptCache
Sourcepub const fn new(ttl: ClaudePromptCacheTtl) -> Self
pub const fn new(ttl: ClaudePromptCacheTtl) -> Self
Build a cache configuration with the chosen TTL.
Sourcepub const fn automatic(ttl: ClaudePromptCacheTtl) -> Self
pub const fn automatic(ttl: ClaudePromptCacheTtl) -> Self
Build an automatic top-level cache configuration.
Sourcepub const fn explicit(
ttl: ClaudePromptCacheTtl,
breakpoints: ClaudeExplicitCacheBreakpoints,
) -> Self
pub const fn explicit( ttl: ClaudePromptCacheTtl, breakpoints: ClaudeExplicitCacheBreakpoints, ) -> Self
Build an explicit block-level cache configuration.
Sourcepub const fn automatic_with_explicit(
ttl: ClaudePromptCacheTtl,
breakpoints: ClaudeExplicitCacheBreakpoints,
) -> Self
pub const fn automatic_with_explicit( ttl: ClaudePromptCacheTtl, breakpoints: ClaudeExplicitCacheBreakpoints, ) -> Self
Build a cache configuration that combines automatic and explicit breakpoints.
Sourcepub const fn with_strategy(self, strategy: ClaudePromptCacheStrategy) -> Self
pub const fn with_strategy(self, strategy: ClaudePromptCacheStrategy) -> Self
Override the cache strategy.
Trait Implementations§
Source§impl Clone for ClaudePromptCache
impl Clone for ClaudePromptCache
Source§fn clone(&self) -> ClaudePromptCache
fn clone(&self) -> ClaudePromptCache
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ClaudePromptCache
Source§impl Debug for ClaudePromptCache
impl Debug for ClaudePromptCache
Source§impl Default for ClaudePromptCache
impl Default for ClaudePromptCache
Source§fn default() -> ClaudePromptCache
fn default() -> ClaudePromptCache
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ClaudePromptCache
impl<'de> Deserialize<'de> for ClaudePromptCache
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 Eq for ClaudePromptCache
Source§impl PartialEq for ClaudePromptCache
impl PartialEq for ClaudePromptCache
Source§impl Serialize for ClaudePromptCache
impl Serialize for ClaudePromptCache
impl StructuralPartialEq for ClaudePromptCache
Auto Trait Implementations§
impl Freeze for ClaudePromptCache
impl RefUnwindSafe for ClaudePromptCache
impl Send for ClaudePromptCache
impl Sync for ClaudePromptCache
impl Unpin for ClaudePromptCache
impl UnsafeUnpin for ClaudePromptCache
impl UnwindSafe for ClaudePromptCache
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