pub struct UserPermissions {
pub computed_permissions: HashMap<String, AccessResult>,
pub last_updated: DateTime<Utc>,
}Expand description
Cached permissions for a user with last updated timestamp.
Fields§
§computed_permissions: HashMap<String, AccessResult>The computed permission results
last_updated: DateTime<Utc>When the permissions were last updated
Implementations§
Source§impl UserPermissions
impl UserPermissions
Sourcepub fn new(permissions: HashMap<String, AccessResult>) -> Self
pub fn new(permissions: HashMap<String, AccessResult>) -> Self
Create new user permissions cache
Sourcepub fn is_expired(&self, ttl_seconds: u64) -> bool
pub fn is_expired(&self, ttl_seconds: u64) -> bool
Check if the cache entry is expired based on TTL
Trait Implementations§
Source§impl Clone for UserPermissions
impl Clone for UserPermissions
Source§fn clone(&self) -> UserPermissions
fn clone(&self) -> UserPermissions
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for UserPermissions
impl RefUnwindSafe for UserPermissions
impl Send for UserPermissions
impl Sync for UserPermissions
impl Unpin for UserPermissions
impl UnwindSafe for UserPermissions
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