pub struct ValidationErrorsBuilder { /* private fields */ }Expand description
Builder for ValidationErrors.
Implementations§
Source§impl ValidationErrorsBuilder
impl ValidationErrorsBuilder
Sourcepub fn new() -> ValidationErrorsBuilder
pub fn new() -> ValidationErrorsBuilder
Create a new builder.
Sourcepub fn add(
self,
field: impl Into<String>,
message: impl Into<String>,
) -> ValidationErrorsBuilder
pub fn add( self, field: impl Into<String>, message: impl Into<String>, ) -> ValidationErrorsBuilder
Add an error.
Sourcepub fn add_if(
self,
condition: bool,
field: impl Into<String>,
message: impl Into<String>,
) -> ValidationErrorsBuilder
pub fn add_if( self, condition: bool, field: impl Into<String>, message: impl Into<String>, ) -> ValidationErrorsBuilder
Add error if condition is true.
Sourcepub fn build(self) -> ValidationErrors
pub fn build(self) -> ValidationErrors
Build and return the ValidationErrors.
Sourcepub fn into_result<T>(self, ok: T) -> Result<T, Error>
pub fn into_result<T>(self, ok: T) -> Result<T, Error>
Build and return as Result.
Trait Implementations§
Source§impl Debug for ValidationErrorsBuilder
impl Debug for ValidationErrorsBuilder
Source§impl Default for ValidationErrorsBuilder
impl Default for ValidationErrorsBuilder
Source§fn default() -> ValidationErrorsBuilder
fn default() -> ValidationErrorsBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ValidationErrorsBuilder
impl RefUnwindSafe for ValidationErrorsBuilder
impl Send for ValidationErrorsBuilder
impl Sync for ValidationErrorsBuilder
impl Unpin for ValidationErrorsBuilder
impl UnsafeUnpin for ValidationErrorsBuilder
impl UnwindSafe for ValidationErrorsBuilder
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