pub struct Config {
pub host: String,
pub username: String,
pub token: String,
}Fields§
§host: String§username: String§token: StringImplementations§
Source§impl Config
impl Config
Sourcepub fn default_path() -> Result<PathBuf>
pub fn default_path() -> Result<PathBuf>
Compute the config-file path the CLI uses by default. Honors
RUNTIME_CONFIG_HOME first (tests), then XDG_CONFIG_HOME,
then falls back to ~/.config.
Sourcepub fn load() -> Result<Self>
pub fn load() -> Result<Self>
Load the config from default_path(). Returns an error if the
file is missing — callers may surface a “run runtime auth login”
hint.
pub fn load_from(path: &Path) -> Result<Self>
Sourcepub fn save(&self) -> Result<PathBuf>
pub fn save(&self) -> Result<PathBuf>
Persist this config, creating the parent directory and clamping
permissions to 0600 on Unix. Overwrites any previous file.
pub fn save_to(&self, path: &Path) -> Result<()>
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
impl Eq for Config
impl StructuralPartialEq for Config
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