pub struct CacheKey<'a> {
pub subject_id: Cow<'a, str>,
pub permission_key: Cow<'a, str>,
}Expand description
Optimized cache key that uses Cow for conditional cloning.
Fields§
§subject_id: Cow<'a, str>§permission_key: Cow<'a, str>Implementations§
Source§impl<'a> CacheKey<'a>
impl<'a> CacheKey<'a>
Sourcepub fn borrowed(subject_id: &'a str, permission_key: &'a str) -> Self
pub fn borrowed(subject_id: &'a str, permission_key: &'a str) -> Self
Create a new cache key with borrowed strings.
Sourcepub fn owned(subject_id: String, permission_key: String) -> Self
pub fn owned(subject_id: String, permission_key: String) -> Self
Create a new cache key with owned strings.
Sourcepub fn into_owned(self) -> CacheKey<'static>
pub fn into_owned(self) -> CacheKey<'static>
Convert to owned cache key.
Trait Implementations§
impl<'a> Eq 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> 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