pub struct UsersCacheFile {
pub caches: HashMap<String, WorkspaceCache>,
}Expand description
Users cache file containing multiple workspace caches
Fields§
§caches: HashMap<String, WorkspaceCache>Implementations§
Source§impl UsersCacheFile
impl UsersCacheFile
Sourcepub fn default_path() -> Result<PathBuf, String>
pub fn default_path() -> Result<PathBuf, String>
Get the default cache file path
Sourcepub fn get_workspace(&self, team_id: &str) -> Option<&WorkspaceCache>
pub fn get_workspace(&self, team_id: &str) -> Option<&WorkspaceCache>
Get workspace cache
Sourcepub fn set_workspace(&mut self, cache: WorkspaceCache)
pub fn set_workspace(&mut self, cache: WorkspaceCache)
Set workspace cache
Sourcepub fn is_expired(&self, team_id: &str, ttl_seconds: u64) -> bool
pub fn is_expired(&self, team_id: &str, ttl_seconds: u64) -> bool
Check if workspace cache is expired
Trait Implementations§
Source§impl Clone for UsersCacheFile
impl Clone for UsersCacheFile
Source§fn clone(&self) -> UsersCacheFile
fn clone(&self) -> UsersCacheFile
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 moreSource§impl Debug for UsersCacheFile
impl Debug for UsersCacheFile
Source§impl Default for UsersCacheFile
impl Default for UsersCacheFile
Source§impl<'de> Deserialize<'de> for UsersCacheFile
impl<'de> Deserialize<'de> for UsersCacheFile
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for UsersCacheFile
impl PartialEq for UsersCacheFile
Source§impl Serialize for UsersCacheFile
impl Serialize for UsersCacheFile
impl StructuralPartialEq for UsersCacheFile
Auto Trait Implementations§
impl Freeze for UsersCacheFile
impl RefUnwindSafe for UsersCacheFile
impl Send for UsersCacheFile
impl Sync for UsersCacheFile
impl Unpin for UsersCacheFile
impl UnwindSafe for UsersCacheFile
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