pub struct Config {
pub default_profile: Option<String>,
pub profiles: IndexMap<String, Profile>,
}Expand description
Represents the full CLI configuration stored on disk.
Fields§
§default_profile: Option<String>§profiles: IndexMap<String, Profile>Implementations§
Source§impl Config
impl Config
Sourcepub fn load<P: AsRef<Path>>(path: Option<P>) -> Result<Self>
pub fn load<P: AsRef<Path>>(path: Option<P>) -> Result<Self>
Load configuration from the provided path or the resolved config file.
Sourcepub fn save_to(&self, path: &Path) -> Result<()>
pub fn save_to(&self, path: &Path) -> Result<()>
Persist the configuration to an explicit path.
Written owner-only: a profile can carry a plaintext api_token, and this
used to land with whatever the umask allowed.
Sourcepub fn save<P: AsRef<Path>>(&self, path: Option<P>) -> Result<()>
pub fn save<P: AsRef<Path>>(&self, path: Option<P>) -> Result<()>
Persist the configuration to the provided path or the resolved config file.
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 Forget for Config
impl Freeze for Config
impl Move 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