pub struct RowKeyEncoder;Expand description
Order-preserving encoder for typed key components.
Encoding rules, component by component (one tag byte, then the payload):
Null: tag only.Bool: tag, then0x00/0x01.IntandTimestampMicros: tag, then 8 big-endian bytes of the value with the sign bit flipped, so byte order matches signed numeric order.TextandBytes: tag, then the payload with every0x00byte escaped as0x00 0xFF, terminated by0x00 0x00— prefix-free and order-preserving.
Components concatenate in declared column order, so a composite key sorts by its first column, then its second, and so on.
Implementations§
Source§impl RowKeyEncoder
impl RowKeyEncoder
Sourcepub fn encode_key(values: &[KeyValue]) -> Key
pub fn encode_key(values: &[KeyValue]) -> Key
Encodes a full key from its typed components.
Sourcepub fn encode_component(out: &mut Vec<u8>, value: &KeyValue)
pub fn encode_component(out: &mut Vec<u8>, value: &KeyValue)
Appends one component to out.
Sourcepub fn decode_components(key: &Key) -> Result<Vec<KeyValue>, PartitionError>
pub fn decode_components(key: &Key) -> Result<Vec<KeyValue>, PartitionError>
Decodes a key back into its components; the inverse of
Self::encode_key. Malformed input fails closed.
Auto Trait Implementations§
impl Freeze for RowKeyEncoder
impl RefUnwindSafe for RowKeyEncoder
impl Send for RowKeyEncoder
impl Sync for RowKeyEncoder
impl Unpin for RowKeyEncoder
impl UnsafeUnpin for RowKeyEncoder
impl UnwindSafe for RowKeyEncoder
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> 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 moreSource§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