pub struct ValidationRule {
pub range: Option<[f64; 2]>,
pub includes: Option<String>,
pub required: Option<bool>,
pub equal: Option<String>,
pub greater: Option<f64>,
pub less: Option<f64>,
pub one_of: Option<Vec<String>>,
}Fields§
§range: Option<[f64; 2]>§includes: Option<String>§required: Option<bool>§equal: Option<String>§greater: Option<f64>§less: Option<f64>§one_of: Option<Vec<String>>Trait Implementations§
Source§impl Clone for ValidationRule
impl Clone for ValidationRule
Source§fn clone(&self) -> ValidationRule
fn clone(&self) -> ValidationRule
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 ValidationRule
impl Debug for ValidationRule
Source§impl<'de> Deserialize<'de> for ValidationRule
impl<'de> Deserialize<'de> for ValidationRule
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl JsonSchema for ValidationRule
impl JsonSchema for ValidationRule
Source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref keyword. Read moreAuto Trait Implementations§
impl Freeze for ValidationRule
impl RefUnwindSafe for ValidationRule
impl Send for ValidationRule
impl Sync for ValidationRule
impl Unpin for ValidationRule
impl UnwindSafe for ValidationRule
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, M, M2> Validatable<InnerValidator<M, ()>, InnerValidatorError<FieldNames, M2>> for Twhere
T: Serialize,
M: 'static,
M2: IntoMessage,
impl<T, M, M2> Validatable<InnerValidator<M, ()>, InnerValidatorError<FieldNames, M2>> for Twhere
T: Serialize,
M: 'static,
M2: IntoMessage,
Source§fn validate(
&self,
validator: InnerValidator<M, ()>,
) -> Result<(), InnerValidatorError<FieldNames, M2>>
fn validate( &self, validator: InnerValidator<M, ()>, ) -> Result<(), InnerValidatorError<FieldNames, M2>>
if not change value
Source§fn validate_mut<'de>(
self,
validator: InnerValidator<M, ()>,
) -> Result<T, InnerValidatorError<FieldNames, M2>>where
T: Deserialize<'de>,
fn validate_mut<'de>(
self,
validator: InnerValidator<M, ()>,
) -> Result<T, InnerValidatorError<FieldNames, M2>>where
T: Deserialize<'de>,
if need to change value, e.g.
trimSource§impl<T, M> Validatable<InnerValidator<M, HashMap<MessageKey<'_>, M>>, InnerValidatorError<FieldNames, M>> for Twhere
T: Serialize,
M: 'static,
impl<T, M> Validatable<InnerValidator<M, HashMap<MessageKey<'_>, M>>, InnerValidatorError<FieldNames, M>> for Twhere
T: Serialize,
M: 'static,
Source§fn validate(
&self,
validator: InnerValidator<M, HashMap<MessageKey<'_>, M>>,
) -> Result<(), InnerValidatorError<FieldNames, M>>
fn validate( &self, validator: InnerValidator<M, HashMap<MessageKey<'_>, M>>, ) -> Result<(), InnerValidatorError<FieldNames, M>>
if not change value
Source§fn validate_mut<'de>(
self,
validator: InnerValidator<M, HashMap<MessageKey<'_>, M>>,
) -> Result<T, InnerValidatorError<FieldNames, M>>where
T: Deserialize<'de>,
fn validate_mut<'de>(
self,
validator: InnerValidator<M, HashMap<MessageKey<'_>, M>>,
) -> Result<T, InnerValidatorError<FieldNames, M>>where
T: Deserialize<'de>,
if need to change value, e.g.
trimSource§impl<'v, T> Validatable<ValidPhrase<'v>, InnerValidatorError<FieldNames, String>> for Twhere
T: Serialize,
impl<'v, T> Validatable<ValidPhrase<'v>, InnerValidatorError<FieldNames, String>> for Twhere
T: Serialize,
Source§fn validate(
&self,
validator: ValidPhrase<'v>,
) -> Result<(), InnerValidatorError<FieldNames, String>>
fn validate( &self, validator: ValidPhrase<'v>, ) -> Result<(), InnerValidatorError<FieldNames, String>>
if not change value
Source§fn validate_mut<'de>(
self,
validator: ValidPhrase<'v>,
) -> Result<T, InnerValidatorError<FieldNames, String>>where
T: Deserialize<'de>,
fn validate_mut<'de>(
self,
validator: ValidPhrase<'v>,
) -> Result<T, InnerValidatorError<FieldNames, String>>where
T: Deserialize<'de>,
if need to change value, e.g.
trim