Struct mz_persist_client::internal::state::EncodedSchemas
source · pub struct EncodedSchemas {
pub key: Bytes,
pub key_data_type: Bytes,
pub val: Bytes,
pub val_data_type: Bytes,
}
Expand description
A key and val Codec::Schema encoded via Codec::encode_schema.
This strategy of directly serializing the schema objects requires that persist users do the right thing. Specifically, that an encoded schema doesn’t in some later version of mz decode to an in-mem object that acts differently. In a sense, the current system (before the introduction of the schema registry) where schemas are passed in unchecked to reader and writer registration calls also has the same defect, so seems fine.
An alternative is to write down here some persist-specific representation of
the schema (e.g. the arrow DataType). This is a lot more work and also has
the potential to lead down a similar failure mode to the mz_persist_types
Data
trait, where the boilerplate isn’t worth the safety. Given that we
can always migrate later by rehydrating these, seems fine to start with the
easy thing.
Fields§
§key: Bytes
A full in-mem K::Schema
impl encoded via Codec::encode_schema.
key_data_type: Bytes
The arrow DataType
produced by this K::Schema
at the time it was
registered, encoded as a ProtoDataType
.
val: Bytes
A full in-mem K::Schema
impl encoded via Codec::encode_schema.
val_data_type: Bytes
The arrow DataType
produced by this V::Schema
at the time it was
registered, encoded as a ProtoDataType
.
Implementations§
source§impl EncodedSchemas
impl EncodedSchemas
pub(crate) fn decode_data_type(buf: &[u8]) -> DataType
Trait Implementations§
source§impl Clone for EncodedSchemas
impl Clone for EncodedSchemas
source§fn clone(&self) -> EncodedSchemas
fn clone(&self) -> EncodedSchemas
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for EncodedSchemas
impl Debug for EncodedSchemas
source§impl PartialEq for EncodedSchemas
impl PartialEq for EncodedSchemas
source§impl RustType<ProtoEncodedSchemas> for EncodedSchemas
impl RustType<ProtoEncodedSchemas> for EncodedSchemas
source§fn into_proto(&self) -> ProtoEncodedSchemas
fn into_proto(&self) -> ProtoEncodedSchemas
Self
into a Proto
value.source§fn from_proto(proto: ProtoEncodedSchemas) -> Result<Self, TryFromProtoError>
fn from_proto(proto: ProtoEncodedSchemas) -> Result<Self, TryFromProtoError>
source§fn into_proto_owned(self) -> Proto
fn into_proto_owned(self) -> Proto
Self::into_proto
that types can
optionally implement, otherwise, the default implementation
delegates to Self::into_proto
.source§impl Serialize for EncodedSchemas
impl Serialize for EncodedSchemas
impl StructuralPartialEq for EncodedSchemas
Auto Trait Implementations§
impl !Freeze for EncodedSchemas
impl RefUnwindSafe for EncodedSchemas
impl Send for EncodedSchemas
impl Sync for EncodedSchemas
impl Unpin for EncodedSchemas
impl UnwindSafe for EncodedSchemas
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,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)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
source§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<T> ProgressEventTimestamp for T
impl<T> ProgressEventTimestamp for T
source§impl<P, R> ProtoType<R> for Pwhere
R: RustType<P>,
impl<P, R> ProtoType<R> for Pwhere
R: RustType<P>,
source§fn into_rust(self) -> Result<R, TryFromProtoError>
fn into_rust(self) -> Result<R, TryFromProtoError>
RustType::from_proto
.source§fn from_rust(rust: &R) -> P
fn from_rust(rust: &R) -> P
RustType::into_proto
.source§impl<'a, S, T> Semigroup<&'a S> for Twhere
T: Semigroup<S>,
impl<'a, S, T> Semigroup<&'a S> for Twhere
T: Semigroup<S>,
source§fn plus_equals(&mut self, rhs: &&'a S)
fn plus_equals(&mut self, rhs: &&'a S)
std::ops::AddAssign
, for types that do not implement AddAssign
.