pub struct UserCache { /* private fields */ }Implementations§
Source§impl UserCache
impl UserCache
pub fn new(enabled: bool) -> Self
pub fn is_enabled(&self) -> bool
pub fn get(&self, user_id: &str) -> Option<User>
pub fn insert(&self, user: User)
pub fn remove(&self, user_id: &str) -> Option<User>
pub fn count(&self) -> usize
pub fn all(&self) -> Vec<User>
pub fn clear(&self)
pub fn initialize_from_ready(&self, data: Value)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for UserCache
impl !RefUnwindSafe for UserCache
impl Send for UserCache
impl Sync for UserCache
impl Unpin for UserCache
impl UnsafeUnpin for UserCache
impl !UnwindSafe for UserCache
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