pub struct ValidationContextBuilder { /* private fields */ }Expand description
Builder for constructing a ValidationContext.
Implementations§
Source§impl ValidationContextBuilder
impl ValidationContextBuilder
Sourcepub fn database(self, validator: impl DatabaseValidator + 'static) -> Self
pub fn database(self, validator: impl DatabaseValidator + 'static) -> Self
Set the database validator.
Sourcepub fn database_arc(self, validator: Arc<dyn DatabaseValidator>) -> Self
pub fn database_arc(self, validator: Arc<dyn DatabaseValidator>) -> Self
Set the database validator from an Arc.
Sourcepub fn http(self, validator: impl HttpValidator + 'static) -> Self
pub fn http(self, validator: impl HttpValidator + 'static) -> Self
Set the HTTP validator.
Sourcepub fn http_arc(self, validator: Arc<dyn HttpValidator>) -> Self
pub fn http_arc(self, validator: Arc<dyn HttpValidator>) -> Self
Set the HTTP validator from an Arc.
Sourcepub fn custom(
self,
name: impl Into<String>,
validator: impl CustomValidator + 'static,
) -> Self
pub fn custom( self, name: impl Into<String>, validator: impl CustomValidator + 'static, ) -> Self
Add a custom validator.
Sourcepub fn custom_arc(
self,
name: impl Into<String>,
validator: Arc<dyn CustomValidator>,
) -> Self
pub fn custom_arc( self, name: impl Into<String>, validator: Arc<dyn CustomValidator>, ) -> Self
Add a custom validator from an Arc.
Sourcepub fn exclude_id(self, id: impl Into<String>) -> Self
pub fn exclude_id(self, id: impl Into<String>) -> Self
Set the ID to exclude from uniqueness checks (for updates).
Sourcepub fn build(self) -> ValidationContext
pub fn build(self) -> ValidationContext
Build the validation context.
Trait Implementations§
Source§impl Default for ValidationContextBuilder
impl Default for ValidationContextBuilder
Source§fn default() -> ValidationContextBuilder
fn default() -> ValidationContextBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ValidationContextBuilder
impl !RefUnwindSafe for ValidationContextBuilder
impl Send for ValidationContextBuilder
impl Sync for ValidationContextBuilder
impl Unpin for ValidationContextBuilder
impl !UnwindSafe for ValidationContextBuilder
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