pub struct Config { /* private fields */ }Expand description
Global configuration for SciRS2
This struct is not intended to be instantiated directly.
Instead, use the get_config and set_config functions to access and modify the configuration.
Implementations§
Source§impl Config
impl Config
Sourcepub fn get(&self, key: &str) -> Option<&ConfigValue>
pub fn get(&self, key: &str) -> Option<&ConfigValue>
Get a configuration value
Sourcepub fn set(&mut self, key: &str, value: ConfigValue)
pub fn set(&mut self, key: &str, value: ConfigValue)
Set a configuration value
Sourcepub fn get_bool(&self, key: &str) -> CoreResult<bool>
pub fn get_bool(&self, key: &str) -> CoreResult<bool>
Get a boolean configuration value
§Errors
Returns CoreError::ConfigError if the key is not found or if the value is not a boolean.
Sourcepub fn get_int(&self, key: &str) -> CoreResult<i64>
pub fn get_int(&self, key: &str) -> CoreResult<i64>
Get an integer configuration value
§Errors
Returns CoreError::ConfigError if the key is not found or if the value is not an integer.
Sourcepub fn get_uint(&self, key: &str) -> CoreResult<u64>
pub fn get_uint(&self, key: &str) -> CoreResult<u64>
Get an unsigned integer configuration value
§Errors
Returns CoreError::ConfigError if the key is not found or if the value is not an unsigned integer.
Sourcepub fn get_float(&self, key: &str) -> CoreResult<f64>
pub fn get_float(&self, key: &str) -> CoreResult<f64>
Get a floating-point configuration value
§Errors
Returns CoreError::ConfigError if the key is not found or if the value cannot be converted to a float.
Sourcepub fn get_string(&self, key: &str) -> CoreResult<String>
pub fn get_string(&self, key: &str) -> CoreResult<String>
Trait Implementations§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more