pub struct CacheControl {
pub control_type: CacheControlType,
pub ttl: Option<String>,
}Expand description
Anthropic-style cache control hint for prefix pinning with TTL.
Fields§
§control_type: CacheControlType§ttl: Option<String>TTL as seconds (integer) or shorthand (“5m” = 300s, “1h” = 3600s). Clamped to [300, 3600].
Implementations§
Source§impl CacheControl
impl CacheControl
Sourcepub fn ttl_seconds(&self) -> u64
pub fn ttl_seconds(&self) -> u64
Parse TTL string to seconds, clamped to [300, 3600].
Accepts integer seconds (“120”, “600”) or shorthand (“5m”, “1h”). Values below 300 are clamped to 300; values above 3600 are clamped to 3600. Unrecognized strings default to 300s.
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 (const: unstable) · 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§fn default() -> CacheControl
fn default() -> CacheControl
Returns the “default value” for a type. Read more
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 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 UnsafeUnpin 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