pub struct ValidationContextBuilder<C> { /* private fields */ }Expand description
Builder for ValidationContext with custom context type
Implementations§
Source§impl<C> ValidationContextBuilder<C>
impl<C> ValidationContextBuilder<C>
Sourcepub fn new() -> ValidationContextBuilder<C>
pub fn new() -> ValidationContextBuilder<C>
Create a new builder
Sourcepub fn locale(self, locale: impl Into<String>) -> ValidationContextBuilder<C>
pub fn locale(self, locale: impl Into<String>) -> ValidationContextBuilder<C>
Set the locale
Sourcepub fn fail_fast(self, fail_fast: bool) -> ValidationContextBuilder<C>
pub fn fail_fast(self, fail_fast: bool) -> ValidationContextBuilder<C>
Set fail-fast mode
Sourcepub fn meta(
self,
key: impl Into<String>,
value: impl Into<String>,
) -> ValidationContextBuilder<C>
pub fn meta( self, key: impl Into<String>, value: impl Into<String>, ) -> ValidationContextBuilder<C>
Add metadata
Sourcepub fn custom(self, custom: C) -> ValidationContextBuilder<C>
pub fn custom(self, custom: C) -> ValidationContextBuilder<C>
Set custom context data
Sourcepub fn build(self) -> ValidationContext
pub fn build(self) -> ValidationContext
Build the context
Trait Implementations§
Auto Trait Implementations§
impl<C> Freeze for ValidationContextBuilder<C>where
C: Freeze,
impl<C> !RefUnwindSafe for ValidationContextBuilder<C>
impl<C> Send for ValidationContextBuilder<C>where
C: Send,
impl<C> Sync for ValidationContextBuilder<C>where
C: Sync,
impl<C> Unpin for ValidationContextBuilder<C>where
C: Unpin,
impl<C> !UnwindSafe for ValidationContextBuilder<C>
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