pub struct ConfigCmdRunner { /* private fields */ }Expand description
ConfigCmdRunner is a struct that holds the configuration file path and provides methods to initialize, set, and show the configuration file.
Implementations§
Source§impl ConfigCmdRunner
impl ConfigCmdRunner
Implementation of ConfigCmdRunner
§Methods
new(cfg_file: String) -> ConfigCmdRunner- creates a new instance of ConfigCmdRunnerinit_file() -> Result<(), std::io::Error>- initializes the configuration fileset_cfg_auth(cfg: ConfigFile) -> Result<ConfigFile, std::io::Error>- sets the authentication data in the configuration fileset_cfg_jira(cfg: ConfigFile) -> Result<ConfigFile, std::io::Error>- sets the Jira URL in the configuration filesetup_cfg(cfg: ConfigFile) -> Result<(), std::io::Error>- sets up the configuration fileshow_cfg(cfg: ConfigFile)- shows the configuration file
Sourcepub fn new(cfg_file: String) -> ConfigCmdRunner
pub fn new(cfg_file: String) -> ConfigCmdRunner
Creates a new instance of ConfigCmdRunner
§Arguments
cfg_file- a String that holds the path to the configuration file
§Returns
ConfigCmdRunner- a new instance of ConfigCmdRunner
§Examples
use jirust_cli::runners::cfg_cmd_runner::ConfigCmdRunner;
let cfg_runner = ConfigCmdRunner::new("test_path/to/config/file".to_string());Sourcepub fn set_cfg_auth(&self, cfg: ConfigFile) -> Result<ConfigFile, Error>
pub fn set_cfg_auth(&self, cfg: ConfigFile) -> Result<ConfigFile, Error>
Sets the authentication data in the configuration file
§Arguments
cfg- a ConfigFile that holds the configuration data
§Returns
Result<ConfigFile, std::io::Error>- a Result that returns the updated ConfigFile or an error
§Examples
use jirust_cli::config::config_file::ConfigFile;
use jirust_cli::runners::cfg_cmd_runner::ConfigCmdRunner;
let cfg_runner = ConfigCmdRunner::new("test_path/to/config/file".to_string());
let cfg = ConfigFile::default();
cfg_runner.set_cfg_auth(cfg);Sourcepub fn set_cfg_jira(&self, cfg: ConfigFile) -> Result<ConfigFile, Error>
pub fn set_cfg_jira(&self, cfg: ConfigFile) -> Result<ConfigFile, Error>
Sets the Jira URL in the configuration file
§Arguments
cfg- a ConfigFile that holds the configuration data
§Returns
Result<ConfigFile, std::io::Error>- a Result that returns the updated ConfigFile or an error
§Examples
use jirust_cli::config::config_file::ConfigFile;
use jirust_cli::runners::cfg_cmd_runner::ConfigCmdRunner;
let cfg_runner = ConfigCmdRunner::new("test_path/to/config/file".to_string());
let cfg = ConfigFile::default();
cfg_runner.set_cfg_jira(cfg);Sourcepub fn setup_cfg(&self, cfg: ConfigFile) -> Result<(), Error>
pub fn setup_cfg(&self, cfg: ConfigFile) -> Result<(), Error>
Sets up the configuration file
§Arguments
cfg- a ConfigFile that holds the configuration data
§Returns
Result<(), std::io::Error>- a Result that returns an empty tuple or an error
§Examples
use jirust_cli::config::config_file::ConfigFile;
use jirust_cli::runners::cfg_cmd_runner::ConfigCmdRunner;
let cfg_runner = ConfigCmdRunner::new("test_path/to/config/file".to_string());
let cfg = ConfigFile::default();
cfg_runner.setup_cfg(cfg);Sourcepub fn show_cfg(&self, cfg: ConfigFile)
pub fn show_cfg(&self, cfg: ConfigFile)
Shows the configuration file data
§Arguments
cfg- a ConfigFile that holds the configuration data
§Examples
use jirust_cli::config::config_file::ConfigFile;
use jirust_cli::runners::cfg_cmd_runner::ConfigCmdRunner;
let cfg = ConfigFile::default();
let cfg_runner = ConfigCmdRunner::new("test_path/to/config/file".to_string());
cfg_runner.show_cfg(cfg);Auto Trait Implementations§
impl Freeze for ConfigCmdRunner
impl RefUnwindSafe for ConfigCmdRunner
impl Send for ConfigCmdRunner
impl Sync for ConfigCmdRunner
impl Unpin for ConfigCmdRunner
impl UnwindSafe for ConfigCmdRunner
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