pub struct Config {
pub debug: u8,
pub config_path: PathBuf,
pub config_data: ConfigData,
pub cli_args: Option<GitMoverCli>,
}
Expand description
Configuration data
Fields§
§debug: u8
debug level
config_path: PathBuf
path to the configuration file
config_data: ConfigData
actual configuration data
cli_args: Option<GitMoverCli>
CLI arguments
Implementations§
Source§impl Config
impl Config
Sourcepub fn with_cli_args(self, cli_args: GitMoverCli) -> Self
pub fn with_cli_args(self, cli_args: GitMoverCli) -> Self
Set the config arguments
Sourcepub fn save(&self)
pub fn save(&self)
Save the config data to the config file
§Panics
Panics if the config file can’t be created or written to
Sourcepub fn new_from_path(custom_path: &PathBuf) -> Config
pub fn new_from_path(custom_path: &PathBuf) -> Config
Sourcepub fn get_config_path() -> PathBuf
pub fn get_config_path() -> PathBuf
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 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