KeySerializer

Struct KeySerializer 

Source
pub struct KeySerializer { /* private fields */ }
Expand description

A builder for constructing binary keys using keycode encoding

Implementations§

Source§

impl KeySerializer

Source

pub fn new() -> Self

Create new serializer with default capacity

Source

pub fn with_capacity(capacity: usize) -> Self

Create with pre-allocated capacity

Source

pub fn extend_bool(&mut self, value: bool) -> &mut Self

Extend with bool value

Source

pub fn extend_f32(&mut self, value: f32) -> &mut Self

Extend with f32 value

Source

pub fn extend_f64(&mut self, value: f64) -> &mut Self

Extend with f64 value

Source

pub fn extend_i8<T: Into<i8>>(&mut self, value: T) -> &mut Self

Extend with i8 value

Source

pub fn extend_i16<T: Into<i16>>(&mut self, value: T) -> &mut Self

Extend with i16 value

Source

pub fn extend_i32<T: Into<i32>>(&mut self, value: T) -> &mut Self

Extend with i32 value

Source

pub fn extend_i64<T: Into<i64>>(&mut self, value: T) -> &mut Self

Extend with i64 value

Source

pub fn extend_i128<T: Into<i128>>(&mut self, value: T) -> &mut Self

Extend with i128 value

Source

pub fn extend_u8<T: Into<u8>>(&mut self, value: T) -> &mut Self

Extend with u8 value

Source

pub fn extend_u16<T: Into<u16>>(&mut self, value: T) -> &mut Self

Extend with u16 value

Source

pub fn extend_u32<T: Into<u32>>(&mut self, value: T) -> &mut Self

Extend with u32 value

Source

pub fn extend_u64<T: Into<u64>>(&mut self, value: T) -> &mut Self

Extend with u64 value

Source

pub fn extend_u128<T: Into<u128>>(&mut self, value: T) -> &mut Self

Extend with u128 value

Source

pub fn extend_bytes<T: AsRef<[u8]>>(&mut self, bytes: T) -> &mut Self

Extend with raw bytes

Source

pub fn extend_str<T: AsRef<str>>(&mut self, s: T) -> &mut Self

Extend with string (UTF-8 bytes)

Source

pub fn finish(self) -> Vec<u8>

Consume serializer and return final buffer

Source

pub fn to_encoded_key(self) -> EncodedKey

Consume serializer and return an EncodedKey directly

Source

pub fn extend_source_id(&mut self, source: impl Into<SourceId>) -> &mut Self

Extend with a SourceId value (includes type discriminator)

Source

pub fn extend_index_id(&mut self, index: impl Into<IndexId>) -> &mut Self

Extend with an IndexId value (includes type discriminator)

Source

pub fn extend_serialize<T: Serialize>(&mut self, value: &T) -> &mut Self

Extend with a serializable value using keycode encoding

Source

pub fn extend_raw(&mut self, bytes: &[u8]) -> &mut Self

Extend with raw bytes (no encoding)

Source

pub fn len(&self) -> usize

Get current buffer length

Source

pub fn is_empty(&self) -> bool

Check if buffer is empty

Source

pub fn extend_date(&mut self, date: &Date) -> &mut Self

Extend with Date value

Source

pub fn extend_datetime(&mut self, datetime: &DateTime) -> &mut Self

Extend with DateTime value

Source

pub fn extend_time(&mut self, time: &Time) -> &mut Self

Extend with Time value

Source

pub fn extend_duration(&mut self, duration: &Duration) -> &mut Self

Extend with Duration value

Source

pub fn extend_row_number(&mut self, row_number: &RowNumber) -> &mut Self

Extend with RowNumber value

Source

pub fn extend_identity_id(&mut self, id: &IdentityId) -> &mut Self

Extend with IdentityId value

Source

pub fn extend_uuid4(&mut self, uuid: &Uuid4) -> &mut Self

Extend with Uuid4 value

Source

pub fn extend_uuid7(&mut self, uuid: &Uuid7) -> &mut Self

Extend with Uuid7 value

Source

pub fn extend_blob(&mut self, blob: &Blob) -> &mut Self

Extend with Blob value

Source

pub fn extend_int(&mut self, int: &Int) -> &mut Self

Extend with arbitrary precision Int value

Source

pub fn extend_uint(&mut self, uint: &Uint) -> &mut Self

Extend with arbitrary precision Uint value

Source

pub fn extend_decimal(&mut self, decimal: &Decimal) -> &mut Self

Extend with Decimal value

Source

pub fn extend_value(&mut self, value: &Value) -> &mut Self

Extend with a Value based on its type

Trait Implementations§

Source§

impl Default for KeySerializer

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more