pub struct ContractSpec {
pub version: String,
pub description: Option<String>,
pub owner: Option<String>,
pub on_breach: OnBreach,
pub allow_extra_fields: bool,
pub fields: Vec<FieldContract>,
}contract only.Expand description
The contract: config block: a declarative, versioned schema + semantic
contract for a pipeline’s output, enforced per page after transforms and
quality checks and before the sink write.
Fields§
§version: StringContract version, e.g. "1.0.0". Required and non-empty. Carried
into breach errors, DLQ envelopes, and every export format so
producers and consumers can pin the promise they agreed on.
Recommendation: bump the major version on breaking changes (removing
a field, narrowing a type) and the minor version on additive ones.
description: Option<String>Human-readable description of the dataset this contract covers.
owner: Option<String>Owning team or person (documentation metadata; carried into exports).
on_breach: OnBreachBreach policy: fail (default) aborts the run, quarantine routes
breaching records to the DLQ (a dlq: block is required), warn
logs + counts but writes everything.
allow_extra_fields: boolWhen false, a top-level key not declared in fields is a breach
(extra_field). Default true — additive fields are allowed.
fields: Vec<FieldContract>The promised top-level fields. Must be non-empty; names must be unique.
Trait Implementations§
Source§impl Clone for ContractSpec
impl Clone for ContractSpec
Source§fn clone(&self) -> ContractSpec
fn clone(&self) -> ContractSpec
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ContractSpec
impl Debug for ContractSpec
Source§impl<'de> Deserialize<'de> for ContractSpec
impl<'de> Deserialize<'de> for ContractSpec
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 ContractSpec
impl JsonSchema for ContractSpec
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 ContractSpec
impl RefUnwindSafe for ContractSpec
impl Send for ContractSpec
impl Sync for ContractSpec
impl Unpin for ContractSpec
impl UnsafeUnpin for ContractSpec
impl UnwindSafe for ContractSpec
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
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> 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