pub struct SchemaBinding {
pub version: u16,
pub connector: String,
pub direction: SchemaDirection,
pub origin: SchemaOrigin,
pub logical: Schema,
pub external: Option<Schema>,
pub value: Option<NativeSchema>,
pub key: Option<NativeSchema>,
pub mapping: Vec<SchemaFieldMapping>,
pub control_fields: Vec<String>,
}Expand description
Immutable connector binding for one catalog generation.
Fields§
§version: u16Version of this encoding and mapping semantics.
connector: StringConnector type, independent of credentials and connection handles.
direction: SchemaDirectionSource or sink binding.
origin: SchemaOriginOrigin of the logical contract.
logical: SchemaComplete logical reader or bound query-output schema.
external: Option<Schema>Native reader/writer fields, when an external authority exists.
value: Option<NativeSchema>Value/table/protocol contract, distinct from observed message writers.
key: Option<NativeSchema>Independently selected key contract, when the codec uses one.
mapping: Vec<SchemaFieldMapping>Field mapping in logical field order.
control_fields: Vec<String>Engine changelog fields consumed by a sink and excluded from business writes.
Implementations§
Source§impl SchemaBinding
impl SchemaBinding
Sourcepub fn logical(
connector: impl Into<String>,
direction: SchemaDirection,
origin: SchemaOrigin,
logical: Schema,
) -> Result<Self, SchemaBindingError>
pub fn logical( connector: impl Into<String>, direction: SchemaDirection, origin: SchemaOrigin, logical: Schema, ) -> Result<Self, SchemaBindingError>
Construct a logical-only contract; no external mutation or inference occurs.
§Errors
Rejects empty/duplicate fields and contracts exceeding the representation bounds.
Sourcepub fn bind_external(
&mut self,
external: Schema,
) -> Result<(), SchemaBindingError>
pub fn bind_external( &mut self, external: Schema, ) -> Result<(), SchemaBindingError>
Bind fields by exact name and type. Sources may project external fields; sinks must supply every writer field and may not discard extra input fields. Casts, defaults and nullable fills require a destination-specific policy.
§Errors
Rejects missing fields, differing types or unsafe directional nullability.
Sourcepub fn canonical_bytes(&self) -> Result<Vec<u8>, SchemaBindingError>
pub fn canonical_bytes(&self) -> Result<Vec<u8>, SchemaBindingError>
Validate structure and produce deterministic JSON without reordering fields or unions.
§Errors
Rejects invalid versions, incomplete mappings, and oversized contracts.
Sourcepub fn fingerprint(&self) -> Result<String, SchemaBindingError>
pub fn fingerprint(&self) -> Result<String, SchemaBindingError>
SHA-256 of the versioned canonical encoding; native identity is also retained.
§Errors
Returns structural or encoding errors for an invalid contract.
Trait Implementations§
Source§impl Clone for SchemaBinding
impl Clone for SchemaBinding
Source§impl Debug for SchemaBinding
impl Debug for SchemaBinding
Source§impl<'de> Deserialize<'de> for SchemaBinding
impl<'de> Deserialize<'de> for SchemaBinding
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>,
impl Eq for SchemaBinding
Source§impl PartialEq for SchemaBinding
impl PartialEq for SchemaBinding
Source§impl Serialize for SchemaBinding
impl Serialize for SchemaBinding
impl StructuralPartialEq for SchemaBinding
Auto Trait Implementations§
impl Freeze for SchemaBinding
impl RefUnwindSafe for SchemaBinding
impl Send for SchemaBinding
impl Sync for SchemaBinding
impl Unpin for SchemaBinding
impl UnsafeUnpin for SchemaBinding
impl UnwindSafe for SchemaBinding
Blanket Implementations§
impl<T> Allocation for T
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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 more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].