pub struct ModelConfig {
pub strict: bool,
pub extra: Extra,
pub str_strip_whitespace: bool,
pub str_to_lower: bool,
pub str_to_upper: bool,
}Expand description
Per-model settings (Pydantic model_config) that leaf types consult.
Settings are not inherited by nested models: each derived model installs its own config while its fields are prepared.
Fields§
§strict: boolReject lax coercions (e.g. "1" for an integer).
extra: ExtraUnknown-key handling.
str_strip_whitespace: boolTrim surrounding whitespace of string inputs.
str_to_lower: boolLower-case string inputs.
str_to_upper: boolUpper-case string inputs.
Implementations§
Source§impl ModelConfig
impl ModelConfig
Trait Implementations§
Source§impl Clone for ModelConfig
impl Clone for ModelConfig
Source§fn clone(&self) -> ModelConfig
fn clone(&self) -> ModelConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ModelConfig
Source§impl Debug for ModelConfig
impl Debug for ModelConfig
Source§impl Default for ModelConfig
impl Default for ModelConfig
Source§fn default() -> ModelConfig
fn default() -> ModelConfig
Returns the “default value” for a type. Read more
impl Eq for ModelConfig
Source§impl PartialEq for ModelConfig
impl PartialEq for ModelConfig
impl StructuralPartialEq for ModelConfig
Auto Trait Implementations§
impl Freeze for ModelConfig
impl RefUnwindSafe for ModelConfig
impl Send for ModelConfig
impl Sync for ModelConfig
impl Unpin for ModelConfig
impl UnsafeUnpin for ModelConfig
impl UnwindSafe for ModelConfig
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.