#[non_exhaustive]pub struct ValidationError {
pub field: String,
pub message: String,
}Expand description
Represents a specific validation error.
field identifies the offending element using a dotted path
(channel.title, item.0.link, feed.id, entry.2.updated, …) so
downstream tooling can dispatch on the field without parsing strings.
message is the full human-readable error text and is what
std::fmt::Display writes — preserving the bare-string format that previous
releases of this crate emitted as the RssError::ValidationErrors
payload.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.field: StringThe dotted path identifying the field that failed validation.
message: StringThe full human-readable error text. Read via Display /
to_string(); matches the string format used in
pre-v0.0.6 releases.
Implementations§
Source§impl ValidationError
impl ValidationError
Sourcepub fn new<F: Into<String>, M: Into<String>>(field: F, message: M) -> Self
pub fn new<F: Into<String>, M: Into<String>>(field: F, message: M) -> Self
Constructs a ValidationError.
field should be the dotted path (e.g. "channel.title");
message is the full human-readable error text and is what
std::fmt::Display writes back out — keeping the bare-string format used
by earlier releases of this crate.
Trait Implementations§
Source§impl Clone for ValidationError
impl Clone for ValidationError
Source§impl Debug for ValidationError
impl Debug for ValidationError
Source§impl Display for ValidationError
impl Display for ValidationError
impl Eq 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)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()