pub struct CacheKey<'a>(/* private fields */);Expand description
A logical cache key.
v0 treats keys as application-provided strings. Query adapters may later derive these keys from SQL text and typed arguments.
§Example
use hydracache_core::CacheKey;
let key = CacheKey::new("users:42");
assert_eq!(key.as_str(), "users:42");Implementations§
Source§impl<'a> CacheKey<'a>
impl<'a> CacheKey<'a>
Sourcepub fn builder() -> CacheKeyBuilder
pub fn builder() -> CacheKeyBuilder
Start building an owned cache key from escaped segments.
§Example
use hydracache_core::CacheKey;
let key = CacheKey::builder()
.segment("tenant:7")
.segment("users")
.segment(42)
.build();
assert_eq!(key.as_str(), "tenant%3A7:users:42");Sourcepub fn into_owned(self) -> CacheKey<'static>
pub fn into_owned(self) -> CacheKey<'static>
Convert this key into an owned key.
Trait Implementations§
impl<'a> Eq for CacheKey<'a>
Source§impl<'a> PartialEq for CacheKey<'a>
impl<'a> PartialEq for CacheKey<'a>
impl<'a> StructuralPartialEq for CacheKey<'a>
Auto Trait Implementations§
impl<'a> Freeze for CacheKey<'a>
impl<'a> RefUnwindSafe for CacheKey<'a>
impl<'a> Send for CacheKey<'a>
impl<'a> Sync for CacheKey<'a>
impl<'a> Unpin for CacheKey<'a>
impl<'a> UnsafeUnpin for CacheKey<'a>
impl<'a> UnwindSafe for CacheKey<'a>
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