pub struct ValidationError {
pub path: String,
pub severity: Severity,
pub rule_id: String,
pub message: String,
}Expand description
A single validation finding at a specific location in a message.
Fields§
§path: StringXPath-like location in the message (e.g. /Document/FIToFICstmrCdtTrf/GrpHdr/MsgId).
severity: SeveritySeverity of the finding.
rule_id: StringRule identifier (e.g. IBAN_CHECK, MAX_LENGTH_35).
message: StringHuman-readable description.
Implementations§
Source§impl ValidationError
impl ValidationError
Sourcepub fn new(
path: impl Into<String>,
severity: Severity,
rule_id: impl Into<String>,
message: impl Into<String>,
) -> Self
pub fn new( path: impl Into<String>, severity: Severity, rule_id: impl Into<String>, message: impl Into<String>, ) -> Self
Create a new ValidationError.
§Examples
use mx20022_validate::error::{ValidationError, Severity};
let err = ValidationError::new("/Document/MsgId", Severity::Error, "MAX_LENGTH_35", "Value exceeds maximum length of 35");
assert_eq!(err.severity, Severity::Error);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 moreAuto Trait Implementations§
impl Freeze for ValidationError
impl RefUnwindSafe for ValidationError
impl Send for ValidationError
impl Sync for ValidationError
impl Unpin for ValidationError
impl UnsafeUnpin 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