pub struct ErrorCollector { /* private fields */ }Expand description
Helper struct for collecting validation errors
Implementations§
Source§impl ErrorCollector
impl ErrorCollector
pub fn new() -> Self
Sourcepub fn add_error(&mut self, error: ValidationError)
pub fn add_error(&mut self, error: ValidationError)
Add an error to the collection
Sourcepub fn add_critical_error(&mut self, error: ValidationError)
pub fn add_critical_error(&mut self, error: ValidationError)
Add a critical error (e.g., missing required field)
Sourcepub fn has_errors(&self) -> bool
pub fn has_errors(&self) -> bool
Check if there are any errors
Sourcepub fn has_critical_errors(&self) -> bool
pub fn has_critical_errors(&self) -> bool
Check if there are critical errors
Sourcepub fn errors(self) -> Vec<ValidationError>
pub fn errors(self) -> Vec<ValidationError>
Get all collected errors
Sourcepub fn error_count(&self) -> usize
pub fn error_count(&self) -> usize
Get the count of errors
Trait Implementations§
Source§impl Debug for ErrorCollector
impl Debug for ErrorCollector
Source§impl Default for ErrorCollector
impl Default for ErrorCollector
Source§fn default() -> ErrorCollector
fn default() -> ErrorCollector
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ErrorCollector
impl RefUnwindSafe for ErrorCollector
impl Send for ErrorCollector
impl Sync for ErrorCollector
impl Unpin for ErrorCollector
impl UnwindSafe for ErrorCollector
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> 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