pub enum RecordCheck {
NotNull {
field: String,
treat_missing_as_null: bool,
on_failure: OnFailure,
},
NotEmpty {
field: String,
on_failure: OnFailure,
},
RegexMatch {
field: String,
pattern: String,
on_failure: OnFailure,
},
ValueInSet {
field: String,
values: Vec<Value>,
on_failure: OnFailure,
},
NotInSet {
field: String,
values: Vec<Value>,
on_failure: OnFailure,
},
Compare {
field: String,
op: CompareOp,
value: Value,
on_failure: OnFailure,
},
TypeIs {
field: String,
expected: JsonType,
on_failure: OnFailure,
},
StringLength {
field: String,
min: Option<usize>,
max: Option<usize>,
on_failure: OnFailure,
},
JsonSchema {
schema: Value,
on_failure: OnFailure,
},
}Available on crate feature
quality only.Expand description
A per-record check. Addressed field accepts the filter/explode path subset
(bare key, dot.path, $['bracketed']).
Variants§
NotNull
Field present and non-null.
Fields
NotEmpty
Field is a string, non-empty after trim().
RegexMatch
Field is a string matching pattern.
ValueInSet
Field value is a member of values (exact JSON equality).
NotInSet
Field value is NOT a member of values (exact JSON equality).
Compare
Field value compares against value under op.
TypeIs
Field’s JSON type equals expected.
StringLength
Field is a string whose char count is within [min, max].
JsonSchema
Available on crate feature
quality-jsonschema only.The whole record validates against a JSON Schema document.
Trait Implementations§
Source§impl Clone for RecordCheck
impl Clone for RecordCheck
Source§fn clone(&self) -> RecordCheck
fn clone(&self) -> RecordCheck
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 moreSource§impl Debug for RecordCheck
impl Debug for RecordCheck
Source§impl<'de> Deserialize<'de> for RecordCheck
impl<'de> Deserialize<'de> for RecordCheck
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 RecordCheck
impl JsonSchema for RecordCheck
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 inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreAuto Trait Implementations§
impl Freeze for RecordCheck
impl RefUnwindSafe for RecordCheck
impl Send for RecordCheck
impl Sync for RecordCheck
impl Unpin for RecordCheck
impl UnsafeUnpin for RecordCheck
impl UnwindSafe for RecordCheck
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