pub enum ConfigError {
OutOfRange {
param: &'static str,
constraint: &'static str,
value: String,
},
Invalid {
param: &'static str,
reason: String,
},
}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
Sourcepub fn out_of_range(
param: &'static str,
constraint: &'static str,
value: impl Display,
) -> ConfigError
pub fn out_of_range( param: &'static str, constraint: &'static str, value: impl Display, ) -> ConfigError
Convenience for the common “value out of range” case.
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
Available on crate feature alloc only.
impl Display for ConfigError
Available on crate feature
alloc only.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(source: ConfigError) -> Self
fn from(source: 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
Converts
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