pub struct FieldContract {
pub name: String,
pub field_type: ContractFieldType,
pub required: bool,
pub nullable: bool,
pub allowed_values: Option<Vec<Value>>,
pub pattern: Option<String>,
pub min: Option<f64>,
pub max: Option<f64>,
pub min_length: Option<usize>,
pub max_length: Option<usize>,
pub description: Option<String>,
}contract only.Expand description
One promised top-level field: its type plus optional semantic constraints.
Fields§
§name: StringTop-level field name (contracts describe the output’s top-level shape;
nested objects are typed as object).
field_type: ContractFieldTypeDeclared type. integer means a JSON number with no fractional part;
number accepts any JSON number.
required: boolWhen true (default) the field must be present in every record.
A non-required field that is absent skips all other checks.
nullable: boolWhen true, an explicit JSON null is allowed (and skips the
type/constraint checks). Default false.
allowed_values: Option<Vec<Value>>Allowed values (exact JSON equality). Must be non-empty when present,
and every value must match the declared type. Use nullable for
null — null is not allowed inside enum.
pattern: Option<String>Regex the value must match. string fields only.
min: Option<f64>Minimum numeric value (inclusive). integer/number fields only.
max: Option<f64>Maximum numeric value (inclusive). integer/number fields only.
min_length: Option<usize>Minimum string length in characters (inclusive). string fields only.
max_length: Option<usize>Maximum string length in characters (inclusive). string fields only.
description: Option<String>Column description (documentation metadata; carried into exports).
Trait Implementations§
Source§impl Clone for FieldContract
impl Clone for FieldContract
Source§fn clone(&self) -> FieldContract
fn clone(&self) -> FieldContract
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 FieldContract
impl Debug for FieldContract
Source§impl<'de> Deserialize<'de> for FieldContract
impl<'de> Deserialize<'de> for FieldContract
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 FieldContract
impl JsonSchema for FieldContract
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 FieldContract
impl RefUnwindSafe for FieldContract
impl Send for FieldContract
impl Sync for FieldContract
impl Unpin for FieldContract
impl UnsafeUnpin for FieldContract
impl UnwindSafe for FieldContract
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