pub enum ValidationError {
MissingRequiredField {
field_path: String,
},
InvalidType {
field_path: String,
expected: String,
found: String,
},
InvalidEnumValue {
field_path: String,
value: String,
allowed: Vec<String>,
},
OutOfRange {
field_path: String,
value: String,
min: Option<String>,
max: Option<String>,
},
InvalidArrayLength {
field_path: String,
length: usize,
min: Option<usize>,
max: Option<usize>,
},
PatternMismatch {
field_path: String,
pattern: String,
},
ConditionalRequirementFailed {
field_path: String,
condition: String,
},
SchemaParseError(String),
TomlParseError(String),
Multiple(Vec<ValidationError>),
UnexpectedTable {
table_path: String,
},
UnexpectedField {
field_path: String,
},
}Expand description
Errors that can occur during TOML validation.
Variants§
MissingRequiredField
A required field is missing from the configuration.
Fields
InvalidType
A field has an invalid type.
Fields
InvalidEnumValue
A field value is not one of the allowed enum values.
Fields
OutOfRange
A numeric value is outside the allowed range.
Fields
InvalidArrayLength
An array has an invalid number of items.
Fields
PatternMismatch
A field value does not match the required pattern.
Fields
ConditionalRequirementFailed
A conditionally required field is missing.
Fields
SchemaParseError(String)
Failed to parse the schema TOML.
TomlParseError(String)
Failed to parse the content TOML.
Multiple(Vec<ValidationError>)
Multiple validation errors occurred.
UnexpectedTable
An unexpected table was found.
UnexpectedField
An unexpected field was found.
Trait Implementations§
Source§impl Clone for ValidationError
impl Clone for ValidationError
Source§fn clone(&self) -> ValidationError
fn clone(&self) -> ValidationError
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 ValidationError
impl Debug for ValidationError
Source§impl Display for ValidationError
impl Display for ValidationError
Source§impl Error for ValidationError
impl Error for ValidationError
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<ValidationError> for RunbeamError
impl From<ValidationError> for RunbeamError
Source§fn from(err: ValidationError) -> Self
fn from(err: ValidationError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for ValidationError
impl RefUnwindSafe for ValidationError
impl Send for ValidationError
impl Sync for ValidationError
impl Unpin for ValidationError
impl UnwindSafe for ValidationError
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> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.