pub enum ConfigError {
OutOfRange {
param: &'static str,
constraint: &'static str,
value: String,
},
Invalid {
param: &'static str,
reason: String,
},
}Available on crate feature
alloc only.Expand description
Structured error for configuration validation failures.
Instead of opaque strings, each variant carries the parameter name and constraint so callers can programmatically inspect what went wrong.
Requires the alloc feature for String fields.
Variants§
OutOfRange
A parameter value is outside its valid range.
§Examples
n_steps must be > 0 (got 0)
learning_rate must be in (0, 1] (got 1.5)Fields
Invalid
A parameter is invalid for a structural reason, typically involving a relationship between two parameters.
§Examples
split_reeval_interval must be >= grace_period (200), got 50
drift_detector.Ddm.drift_level must be > warning_level (3.0), got 2.0Implementations§
Source§impl ConfigError
impl ConfigError
Trait Implementations§
Source§impl Clone for ConfigError
impl Clone for ConfigError
Source§fn clone(&self) -> ConfigError
fn clone(&self) -> ConfigError
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ConfigError
impl Debug for ConfigError
Source§impl Display for ConfigError
impl Display for ConfigError
Source§impl Error for ConfigError
Available on crate feature std only.
impl Error for ConfigError
Available on crate feature
std only.1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<ConfigError> for IrithyllError
impl From<ConfigError> for IrithyllError
Source§fn from(e: ConfigError) -> Self
fn from(e: ConfigError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for ConfigError
impl RefUnwindSafe for ConfigError
impl Send for ConfigError
impl Sync for ConfigError
impl Unpin for ConfigError
impl UnsafeUnpin for ConfigError
impl UnwindSafe for ConfigError
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