pub struct CacheKey;Expand description
Cache key builder for standardized key generation.
Generates deterministic cache keys from requests.
Implementations§
Source§impl CacheKey
impl CacheKey
Sourcepub fn from_parts(provider: &str, model: &str, content: &str) -> String
pub fn from_parts(provider: &str, model: &str, content: &str) -> String
Generate a cache key from a request.
Uses blake3 for cryptographically secure and deterministic hashing.
§Example
use simple_agent_type::cache::CacheKey;
let key = CacheKey::from_parts("openai", "gpt-4", "user:Hello");
assert!(key.starts_with("openai:"));Sourcepub fn with_namespace(namespace: &str, key: &str) -> String
pub fn with_namespace(namespace: &str, key: &str) -> String
Generate a cache key with custom namespace.
Auto Trait Implementations§
impl Freeze for CacheKey
impl RefUnwindSafe for CacheKey
impl Send for CacheKey
impl Sync for CacheKey
impl Unpin for CacheKey
impl UnwindSafe for CacheKey
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