Struct mz_persist_client::cli::inspect::K
source · pub(crate) struct K;
Expand description
The following is a very terrible hack that no one should draw inspiration from. Currently State
is generic over <K, V, T, D>, with KVD being represented as phantom data for type safety and to
detect persisted codec mismatches. However, reading persisted States does not require actually
decoding KVD, so we only need their codec names to match, not the full types. For the purposes
of persistcli inspect
, which only wants to read the persistent data, we create new types that
return static Codec names, and rebind the names if/when we get a CodecMismatch, so we can convince
the type system and our safety checks that we really can read the data.
Trait Implementations§
source§impl Codec for K
impl Codec for K
§type Storage = ()
type Storage = ()
A type used with Self::decode_from for allocation reuse. Set to
()
if unnecessary.source§fn codec_name() -> String
fn codec_name() -> String
Name of the codec. Read more
source§fn encode<B>(&self, _buf: &mut B)where
B: BufMut,
fn encode<B>(&self, _buf: &mut B)where
B: BufMut,
Encode a key or value for permanent storage. Read more
source§fn decode(_buf: &[u8], _schema: &TodoSchema<K>) -> Result<Self, String>
fn decode(_buf: &[u8], _schema: &TodoSchema<K>) -> Result<Self, String>
Decode a key or value previous encoded with this codec’s
Codec::encode. Read more
source§fn encode_schema(_schema: &Self::Schema) -> Bytes
fn encode_schema(_schema: &Self::Schema) -> Bytes
Encode a schema for permanent storage. Read more
source§fn decode_schema(buf: &Bytes) -> Self::Schema
fn decode_schema(buf: &Bytes) -> Self::Schema
Decode a schema previous encoded with this codec’s
Self::encode_schema. Read more
impl Eq for K
impl StructuralPartialEq for K
Auto Trait Implementations§
impl Freeze for K
impl RefUnwindSafe for K
impl Send for K
impl Sync for K
impl Unpin for K
impl UnwindSafe for K
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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>
Wrap the input message
T
in a tonic::Request
Creates a shared type from an unshared type.
source§impl<T> Pointable for T
impl<T> Pointable 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>
See
RustType::from_proto
.source§fn from_rust(rust: &R) -> P
fn from_rust(rust: &R) -> P
See
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)
The method of
std::ops::AddAssign
, for types that do not implement AddAssign
.