pub struct CacheControl {
pub kind: String,
pub ttl: Option<CacheTtl>,
}Expand description
Cache control configuration for content blocks
Used to enable prompt caching on specific content blocks. When mixing TTLs in a single request, 1-hour cache entries must appear before 5-minute entries.
Fields§
§kind: StringCache type (currently only “ephemeral” is supported)
ttl: Option<CacheTtl>Time-to-live for the cache entry
Implementations§
Source§impl CacheControl
impl CacheControl
Sourcepub fn ephemeral_5m() -> Self
pub fn ephemeral_5m() -> Self
Creates an ephemeral cache control with 5-minute TTL
Sourcepub fn ephemeral_1h() -> Self
pub fn ephemeral_1h() -> Self
Creates an ephemeral cache control with 1-hour TTL
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<'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