pub struct Config {
pub organization_guid: Option<String>,
pub unit_name: Option<String>,
pub last_username: Option<String>,
pub offline_mode: bool,
pub config_dir_override: Option<PathBuf>,
pub cache_dir_override: Option<PathBuf>,
}Fields§
§organization_guid: Option<String>§unit_name: Option<String>§last_username: Option<String>§offline_mode: bool§config_dir_override: Option<PathBuf>Explicit config directory override (for mobile platforms where dirs doesn’t work).
cache_dir_override: Option<PathBuf>Explicit cache directory override (for mobile platforms).
Implementations§
Source§impl Config
impl Config
pub fn load() -> Result<Self>
Sourcepub fn load_from(config_dir: PathBuf) -> Result<Self>
pub fn load_from(config_dir: PathBuf) -> Result<Self>
Load config from an explicit directory (for mobile where dirs doesn’t work).
pub fn save(&self) -> Result<()>
pub fn cache_dir(&self) -> Result<PathBuf>
Sourcepub fn set_cache_dir(&mut self, dir: PathBuf)
pub fn set_cache_dir(&mut self, dir: PathBuf)
Set an explicit cache directory (for mobile).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
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 Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
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