pub struct ValidateOptions {
pub strict: bool,
pub from_attributes: bool,
pub context: Option<HashMap<String, Value>>,
pub update: Option<HashMap<String, Value>>,
}Expand description
Options for model_validate().
Controls the validation behavior.
Fields§
§strict: boolIf true, use strict type coercion (no implicit conversions).
from_attributes: boolIf true, read from object attributes (ORM mode). Currently unused - reserved for future from_attributes support.
context: Option<HashMap<String, Value>>Optional context dictionary passed to custom validators.
update: Option<HashMap<String, Value>>Additional values to merge into the result after parsing.
Implementations§
Source§impl ValidateOptions
impl ValidateOptions
Sourcepub fn from_attributes(self) -> Self
pub fn from_attributes(self) -> Self
Enable from_attributes mode (read from object attributes).
Sourcepub fn with_context(self, context: HashMap<String, Value>) -> Self
pub fn with_context(self, context: HashMap<String, Value>) -> Self
Set context for custom validators.
Sourcepub fn with_update(self, update: HashMap<String, Value>) -> Self
pub fn with_update(self, update: HashMap<String, Value>) -> Self
Set values to merge into result.
Trait Implementations§
Source§impl Clone for ValidateOptions
impl Clone for ValidateOptions
Source§fn clone(&self) -> ValidateOptions
fn clone(&self) -> ValidateOptions
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ValidateOptions
impl Debug for ValidateOptions
Source§impl Default for ValidateOptions
impl Default for ValidateOptions
Source§fn default() -> ValidateOptions
fn default() -> ValidateOptions
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ValidateOptions
impl RefUnwindSafe for ValidateOptions
impl Send for ValidateOptions
impl Sync for ValidateOptions
impl Unpin for ValidateOptions
impl UnwindSafe for ValidateOptions
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).