pub struct ValidationBuilder<T: KeyDomain> { /* private fields */ }Expand description
Builder for creating comprehensive validation configurations
This builder allows you to create complex validation scenarios with custom requirements and error handling.
Implementations§
Source§impl<T: KeyDomain> ValidationBuilder<T>
impl<T: KeyDomain> ValidationBuilder<T>
Sourcepub fn allow_empty_collection(self, allow: bool) -> Self
pub fn allow_empty_collection(self, allow: bool) -> Self
Allow validation of empty collections
Sourcepub fn max_failures(self, max: usize) -> Self
pub fn max_failures(self, max: usize) -> Self
Set maximum number of failures before stopping validation
Sourcepub fn stop_on_first_error(self, stop: bool) -> Self
pub fn stop_on_first_error(self, stop: bool) -> Self
Stop validation on the first error encountered
Sourcepub fn custom_validator(
self,
validator: fn(&str) -> Result<(), KeyParseError>,
) -> Self
pub fn custom_validator( self, validator: fn(&str) -> Result<(), KeyParseError>, ) -> Self
Add a custom validator function
Sourcepub fn validate<I>(&self, keys: I) -> ValidationResult
pub fn validate<I>(&self, keys: I) -> ValidationResult
Validate a collection of strings with the configured settings
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for ValidationBuilder<T>
impl<T> RefUnwindSafe for ValidationBuilder<T>where
T: RefUnwindSafe,
impl<T> Send for ValidationBuilder<T>
impl<T> Sync for ValidationBuilder<T>
impl<T> Unpin for ValidationBuilder<T>where
T: Unpin,
impl<T> UnsafeUnpin for ValidationBuilder<T>
impl<T> UnwindSafe for ValidationBuilder<T>where
T: UnwindSafe,
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