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,
},
}quality only.Expand description
A per-record check. Addressed field accepts the filter/explode path subset
(bare key, dot.path, $['bracketed']).
Every variant carries field (the path to check) and on_failure (what a
failure does). Per-record checks accept only OnFailure::Quarantine or
OnFailure::Abort — quarantine_batch is rejected at compile time
because a per-record failure is always attributable to one row.
Variants§
NotNull
Field present and non-null.
Fields
NotEmpty
Field is a string, non-empty after trim().
Fields
RegexMatch
Field is a string matching pattern.
Fields
ValueInSet
Field value is a member of values (exact JSON equality).
Fields
NotInSet
Field value is NOT a member of values (exact JSON equality).
Fields
Compare
Field value compares against value under op.
Fields
TypeIs
Field’s JSON type equals expected.
Fields
StringLength
Field is a string whose char count is within [min, max].
Fields
min: Option<usize>Inclusive minimum length in Unicode characters (not bytes). Omit for no lower bound.
JsonSchema
quality-jsonschema only.The whole record validates against a JSON Schema document.
Trait Implementations§
Source§impl Clone for RecordCheck
impl Clone for RecordCheck
Source§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>,
Source§impl JsonSchema for RecordCheck
impl JsonSchema for RecordCheck
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$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§
impl<T> Allocation for T
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request