pub struct CacheKitBuilder { /* private fields */ }Expand description
Fluent builder for CacheKit.
Implementations§
Source§impl CacheKitBuilder
impl CacheKitBuilder
Sourcepub fn backend(self, backend: SharedBackend) -> Self
pub fn backend(self, backend: SharedBackend) -> Self
Set the storage backend.
Sourcepub fn default_ttl(self, ttl: Duration) -> Self
pub fn default_ttl(self, ttl: Duration) -> Self
Override the default TTL (used when no per-call TTL is specified).
Sourcepub fn namespace(self, ns: impl Into<String>) -> Self
pub fn namespace(self, ns: impl Into<String>) -> Self
Set a namespace prefix. All keys will be stored as {namespace}:{key}.
Sourcepub fn max_payload_bytes(self, limit: usize) -> Self
pub fn max_payload_bytes(self, limit: usize) -> Self
Set the maximum accepted payload size in bytes.
Sourcepub fn l1_capacity(self, capacity: usize) -> Self
pub fn l1_capacity(self, capacity: usize) -> Self
Set the L1 cache capacity (max entries).
Sourcepub fn encryption_from_bytes(
self,
master_key: &[u8],
tenant_id: &str,
) -> Result<Self, CachekitError>
pub fn encryption_from_bytes( self, master_key: &[u8], tenant_id: &str, ) -> Result<Self, CachekitError>
Configure encryption from raw master key bytes and tenant ID.
The master key must be at least 16 bytes (32 recommended). Keys are derived per-tenant via HKDF-SHA256.
Sourcepub fn encryption(
self,
hex_key: &str,
tenant_id: &str,
) -> Result<Self, CachekitError>
pub fn encryption( self, hex_key: &str, tenant_id: &str, ) -> Result<Self, CachekitError>
Configure encryption from a hex-encoded master key string.
Convenience wrapper that hex-decodes then delegates to
Self::encryption_from_bytes.
Trait Implementations§
Source§impl Default for CacheKitBuilder
impl Default for CacheKitBuilder
Source§fn default() -> CacheKitBuilder
fn default() -> CacheKitBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for CacheKitBuilder
impl !RefUnwindSafe for CacheKitBuilder
impl Send for CacheKitBuilder
impl Sync for CacheKitBuilder
impl Unpin for CacheKitBuilder
impl UnsafeUnpin for CacheKitBuilder
impl !UnwindSafe for CacheKitBuilder
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