pub struct ArgsManagerInner {
    pub settings: Settings,
    pub command: Vec<String>,
    pub network: Option<String>,
    pub network_only_args: HashSet<String>,
    pub available_args: HashMap<OptionsCategory, HashMap<String, ArgsManagerArg>>,
    pub accept_any_command: bool,
    pub config_sections: LinkedList<SectionInfo>,
    pub cached_blocks_path: Option<Box<Path>>,
    pub cached_datadir_path: Option<Box<Path>>,
    pub cached_network_datadir_path: Option<Box<Path>>,
}

Fields§

§settings: Settings§command: Vec<String>§network: Option<String>§network_only_args: HashSet<String>§available_args: HashMap<OptionsCategory, HashMap<String, ArgsManagerArg>>§accept_any_command: bool§config_sections: LinkedList<SectionInfo>§cached_blocks_path: Option<Box<Path>>§cached_datadir_path: Option<Box<Path>>§cached_network_datadir_path: Option<Box<Path>>

Implementations§

source§

impl ArgsManagerInner

source

pub fn add_command(&mut self, cmd: &str, help: &str)

| Add subcommand |

source

pub fn add_arg(&mut self, x: &ArgDescriptor)

| Add argument |

source

pub fn add_hidden_args(&mut self, names: &Vec<&'static str>)

| Add many hidden arguments |

source

pub fn setup_cli_args(&mut self)

source§

impl ArgsManagerInner

source

pub fn setup_chain_params_base_options(&mut self)

| Set the arguments for chainparams |

source§

impl ArgsManagerInner

source

pub fn clear_args(&mut self)

| Clear available arguments |

source

pub fn clear_path_cache(&mut self)

| Clear cached directory paths |

source§

impl ArgsManagerInner

source

pub fn get_arg_flags(&self, name: &str) -> Option<u32>

source

pub fn get_args(&self, str_arg: &str) -> Vec<String>

source

pub fn get_arg(&self, str_arg: &str, str_default: &str) -> String

source

pub fn get_int_arg(&self, str_arg: &str, n_default: i64) -> i64

| Return integer argument or default | value | | ———– | @param strArg | | Argument to get (e.g. “-foo”) | ––––– | @param nDefault | | (e.g. 1) | | ———– | @return | | command-line argument (0 if invalid | number) or default value |

source

pub fn get_bool_arg(&self, str_arg: &str, default: bool) -> bool

| Return boolean argument or default | value | | ———– | @param strArg | | Argument to get (e.g. “-foo”) | ––––– | @param fDefault | | (true or false) | | ———– | @return | | command-line argument or default value |

source§

impl ArgsManagerInner

source

pub fn get_blocks_dir_path(&self) -> Box<Path>

| Get blocks directory path | | ———– | @return | | Blocks path which is network specific |

source§

impl ArgsManagerInner

source

pub fn get_chain_name(&mut self) -> Result<String, StdException>

| Returns the appropriate chain name | from the program arguments. | | | ———– | @return | | CBaseChainParams::MAIN by default; | raises runtime error if an invalid combination | is given. |

source§

impl ArgsManagerInner

source

pub fn get_command(&self) -> Option<ArgsManagerCommand>

| Get the command and command args (returns | std::nullopt if no command provided) |

source§

impl ArgsManagerInner

source

pub fn get_data_dir_base(&self) -> PathBuf

| Get data directory path | | | ———– | @return | | Absolute path on success, otherwise | an empty path when a non-directory path | would be returned @post Returned directory | path is created unless it is empty |

source

pub fn get_data_dir_net(&self) -> PathBuf

| Get data directory path with appended | network identifier | | ———– | @return | | Absolute path on success, otherwise | an empty path when a non-directory path | would be returned @post Returned directory | path is created unless it is empty |

source

pub fn get_data_dir(&self, net_specific: bool) -> PathBuf

| Get data directory path | | ———– | @param net_specific | | Append network identifier to the returned | path | | ———– | @return | | Absolute path on success, otherwise | an empty path when a non-directory path | would be returned @post Returned directory | path is created unless it is empty |

source§

impl ArgsManagerInner

source

pub fn get_help_message(&self) -> String

| Get the help string |

source§

impl ArgsManagerInner

source

pub fn get_settings_path( &self, filepath: Option<&mut Box<Path>>, temp: Option<bool> ) -> bool

| Get settings file path, or return false | if read-write settings were disabled | with -nosettings. |

source

pub fn get_setting(&self, arg: &str) -> SettingsValue

| Get setting value. | | Result will be null if setting was unset, | true if “-setting” argument was passed | false if “-nosetting” argument was | passed, and a string if a “-setting=value” | argument was passed. |

source

pub fn get_settings_list(&self, arg: &str) -> Vec<SettingsValue>

| Get list of setting values. |

source§

impl ArgsManagerInner

source

pub fn get_unrecognized_sections(&self) -> LinkedList<SectionInfo>

| Log warnings for unrecognized section | names in the config file. |

source§

impl ArgsManagerInner

source

pub fn help_requested(&self) -> bool

| @return | | true if help has been requested via a | command-line arg |

source

pub fn setup_help_options(&mut self)

| Add help options to the args manager |

source§

impl ArgsManagerInner

source

pub fn log_args_prefix( &self, prefix: &str, section: &str, args: &HashMap<String, Vec<SettingsValue>> )

| Helper function for LogArgs(). |

source

pub fn log_args(&self)

| Log the config file options and the command | line arguments, useful for troubleshooting. |

source§

impl ArgsManagerInner

source

pub fn parse_parameters( &mut self, argv: &Vec<String>, error: &mut String ) -> bool

source§

impl ArgsManagerInner

source

pub fn is_arg_set(&self, str_arg: &str) -> bool

| Return true if the given argument has | been manually set | | ———– | @param strArg | | Argument to get (e.g. “-foo”) | | ———– | @return | | true if the argument has been set |

source

pub fn is_arg_negated(&self, str_arg: &str) -> bool

| Return true if the argument was originally | passed as a negated option, i.e. -nofoo. | | ———– | @param strArg | | Argument to get (e.g. “-foo”) | | ———– | @return | | true if the argument was passed negated |

source§

impl ArgsManagerInner

source

pub fn read_config_stream<R: Read>( &mut self, stream: &mut BufReader<R>, filepath: &str, error: &mut String, ignore_invalid_keys: Option<bool> ) -> bool

source

pub fn read_config_files( &mut self, error: &mut String, ignore_invalid_keys: Option<bool> ) -> bool

source§

impl ArgsManagerInner

source

pub fn select_config_network(&mut self, network: &str)

| Select the network in use |

source§

impl ArgsManagerInner

source

pub fn lock_settings<F: Fn(&Settings)>(&mut self, fn_: F)

| Access settings with lock held. |

source

pub fn init_settings(&mut self, error: &mut String) -> Result<(), String>

| Read and update settings file with saved | settings. This needs to be called after | SelectParams() because the settings | file location is network-specific. |

source

pub fn read_settings_file(&mut self, errors: Option<&mut Vec<String>>) -> bool

| Read settings file. Push errors to vector, | or log them if null. |

source

pub fn write_settings_file( &self, errors: Option<&mut Vec<String>> ) -> Result<bool, StdException>

| Write settings file. Push errors to | vector, or log them if null. |

source§

impl ArgsManagerInner

source

pub fn soft_set_arg(&mut self, str_arg: &str, str_value: &str) -> bool

| Set an argument if it doesn’t already | have a value | | ———– | @param strArg | | Argument to set (e.g. “-foo”) | ––––– | @param strValue | | Value (e.g. “1”) | | ———– | @return | | true if argument gets set, false if it | already had a value |

source

pub fn force_set_arg(&mut self, str_arg: &str, str_value: &str)

| Forces an arg setting. Called by | | SoftSetArg() if the arg hasn’t already | been set. Also called directly in testing. |

source

pub fn soft_set_bool_arg(&mut self, str_arg: &str, value: bool) -> bool

| Set a boolean argument if it doesn’t | already have a value | | ———– | @param strArg | | Argument to set (e.g. “-foo”) | ––––– | @param fValue | | Value (e.g. false) | | ———– | @return | | true if argument gets set, false if it | already had a value |

source§

impl ArgsManagerInner

source

pub fn use_default_section(&self, arg: &str) -> bool

| Returns true if settings values from | the default section should be used, | depending on the current network and | whether the setting is network-specific. |

Trait Implementations§

source§

impl Default for ArgsManagerInner

source§

fn default() -> ArgsManagerInner

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T, U> CastInto<U> for Twhere U: CastFrom<T>,

§

unsafe fn cast_into(self) -> U

Performs the conversion. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = mem::align_of::<T>()

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> StaticUpcast<T> for T

§

unsafe fn static_upcast(ptr: Ptr<T>) -> Ptr<T>

Convert type of a const pointer. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V