pub struct SchemaResolver { /* private fields */ }Expand description
Resolves differences between source and target schemas.
Used when reading data that was written with an older schema version using a newer schema, or vice versa.
Implementations§
Source§impl SchemaResolver
impl SchemaResolver
Sourcepub fn new(source: Schema, target: Schema) -> Option<Self>
pub fn new(source: Schema, target: Schema) -> Option<Self>
Create a resolver to read data from source schema as target schema.
Returns None if the schemas are incompatible (e.g., type mismatch on same-named field without valid widening path).
Sourcepub fn mappings(&self) -> &[FieldMapping]
pub fn mappings(&self) -> &[FieldMapping]
Get the field mappings
Sourcepub fn is_identity(&self) -> bool
pub fn is_identity(&self) -> bool
Check if this is an identity mapping (source == target)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SchemaResolver
impl RefUnwindSafe for SchemaResolver
impl Send for SchemaResolver
impl Sync for SchemaResolver
impl Unpin for SchemaResolver
impl UnsafeUnpin for SchemaResolver
impl UnwindSafe for SchemaResolver
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
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>
Converts
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>
Converts
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