pub struct CachekitConfigBuilder { /* private fields */ }Expand description
Fluent builder for CachekitConfig.
Implementations§
Source§impl CachekitConfigBuilder
impl CachekitConfigBuilder
Sourcepub fn api_url(self, url: impl Into<String>) -> Result<Self, CachekitError>
pub fn api_url(self, url: impl Into<String>) -> Result<Self, CachekitError>
Set the API base URL. Must use HTTPS.
Sourcepub fn master_key(self, hex_key: &str) -> Result<Self, CachekitError>
pub fn master_key(self, hex_key: &str) -> Result<Self, CachekitError>
Set the master key from a hex string. Must decode to at least 32 bytes.
Sourcepub fn default_ttl(self, ttl: Duration) -> Result<Self, CachekitError>
pub fn default_ttl(self, ttl: Duration) -> Result<Self, CachekitError>
Set the default TTL. Must be at least 1 second.
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 build(self) -> CachekitConfig
pub fn build(self) -> CachekitConfig
Finalise and return the CachekitConfig.
Trait Implementations§
Source§impl Default for CachekitConfigBuilder
impl Default for CachekitConfigBuilder
Source§fn default() -> CachekitConfigBuilder
fn default() -> CachekitConfigBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for CachekitConfigBuilder
impl RefUnwindSafe for CachekitConfigBuilder
impl Send for CachekitConfigBuilder
impl Sync for CachekitConfigBuilder
impl Unpin for CachekitConfigBuilder
impl UnsafeUnpin for CachekitConfigBuilder
impl UnwindSafe for CachekitConfigBuilder
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