pub struct CacheOptions { /* private fields */ }Expand description
Per-entry cache behavior.
Options are passed to put, get_or_load, and loader helper methods.
§Example
use std::time::Duration;
use hydracache_core::CacheOptions;
let options = CacheOptions::new()
.ttl(Duration::from_secs(60))
.tags(["users", "user:42"]);
assert_eq!(options.ttl_value(), Some(Duration::from_secs(60)));
assert_eq!(options.tags_value(), &["users".to_owned(), "user:42".to_owned()]);Implementations§
Source§impl CacheOptions
impl CacheOptions
Attach tags used by invalidate_tag.
Return tags attached to this entry.
Trait Implementations§
Source§impl Clone for CacheOptions
impl Clone for CacheOptions
Source§fn clone(&self) -> CacheOptions
fn clone(&self) -> CacheOptions
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 CacheOptions
impl Debug for CacheOptions
Source§impl Default for CacheOptions
impl Default for CacheOptions
Source§fn default() -> CacheOptions
fn default() -> CacheOptions
Returns the “default value” for a type. Read more
impl Eq for CacheOptions
Source§impl PartialEq for CacheOptions
impl PartialEq for CacheOptions
Source§fn eq(&self, other: &CacheOptions) -> bool
fn eq(&self, other: &CacheOptions) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for CacheOptions
Auto Trait Implementations§
impl Freeze for CacheOptions
impl RefUnwindSafe for CacheOptions
impl Send for CacheOptions
impl Sync for CacheOptions
impl Unpin for CacheOptions
impl UnsafeUnpin for CacheOptions
impl UnwindSafe for CacheOptions
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