pub struct Validation { /* private fields */ }Expand description
A record of validation results.
Implementations§
Source§impl Validation
impl Validation
Sourcepub fn from_entry(key: impl Into<SharedString>, err: impl Into<Error>) -> Self
pub fn from_entry(key: impl Into<SharedString>, err: impl Into<Error>) -> Self
Creates a new instance with the entry.
Sourcepub fn record(
&mut self,
key: impl Into<SharedString>,
message: impl Into<SharedString>,
)
pub fn record( &mut self, key: impl Into<SharedString>, message: impl Into<SharedString>, )
Records an entry with the supplied message.
Sourcepub fn record_fail(
&mut self,
key: impl Into<SharedString>,
err: impl Into<Error>,
)
pub fn record_fail( &mut self, key: impl Into<SharedString>, err: impl Into<Error>, )
Records an entry for the error.
Sourcepub fn validate_format(
&mut self,
key: impl Into<SharedString>,
value: &str,
format: &str,
)
pub fn validate_format( &mut self, key: impl Into<SharedString>, value: &str, format: &str, )
Validates the string value with a specific format.
Sourcepub fn contains_key(&self, key: &str) -> bool
pub fn contains_key(&self, key: &str) -> bool
Returns true if the validation contains a value for the specified key.
Sourcepub fn is_success(&self) -> bool
pub fn is_success(&self) -> bool
Returns true if the validation is success.
Sourcepub fn invalid_params(&self) -> Vec<&str>
pub fn invalid_params(&self) -> Vec<&str>
Returns a list of invalid params.
Trait Implementations§
Source§impl Debug for Validation
impl Debug for Validation
Source§impl Default for Validation
impl Default for Validation
Source§fn default() -> Validation
fn default() -> Validation
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for Validation
impl !RefUnwindSafe for Validation
impl Send for Validation
impl !Sync for Validation
impl Unpin for Validation
impl !UnwindSafe for Validation
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
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.