pub struct ConfigCache {
pub selected_provider: Option<String>,
pub last_updated: Option<u64>,
pub version: u32,
}Expand description
Configuration cache to store user’s provider selection
Fields§
§selected_provider: Option<String>Last selected provider
last_updated: Option<u64>Timestamp of last selection
version: u32Cache version for compatibility
Implementations§
Source§impl ConfigCache
impl ConfigCache
Sourcepub fn default_cache_path() -> PathBuf
pub fn default_cache_path() -> PathBuf
Get the default cache file path
Sourcepub fn set_selected_provider(&mut self, provider: String)
pub fn set_selected_provider(&mut self, provider: String)
Update the selected provider
Sourcepub fn get_selected_provider(&self) -> Option<&String>
pub fn get_selected_provider(&self) -> Option<&String>
Get the selected provider
Sourcepub fn is_expired(&self) -> bool
pub fn is_expired(&self) -> bool
Check if the cache is expired (older than 30 days)
Trait Implementations§
Source§impl Clone for ConfigCache
impl Clone for ConfigCache
Source§fn clone(&self) -> ConfigCache
fn clone(&self) -> ConfigCache
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ConfigCache
impl Debug for ConfigCache
Source§impl Default for ConfigCache
impl Default for ConfigCache
Source§impl<'de> Deserialize<'de> for ConfigCache
impl<'de> Deserialize<'de> for ConfigCache
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
Auto Trait Implementations§
impl Freeze for ConfigCache
impl RefUnwindSafe for ConfigCache
impl Send for ConfigCache
impl Sync for ConfigCache
impl Unpin for ConfigCache
impl UnsafeUnpin for ConfigCache
impl UnwindSafe for ConfigCache
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