Skip to main content

PartitionKeyBuilder

Struct PartitionKeyBuilder 

Source
pub struct PartitionKeyBuilder(/* private fields */);
Expand description

Builder for a v1 canonical logical partition key.

Implementations§

Source§

impl PartitionKeyBuilder

Source

pub fn new(aggregate_type: AggregateTypeId) -> Self

Starts a partition key with its purpose namespace, version, and aggregate type.

Source

pub fn push_bool(&mut self, value: bool) -> Result<&mut Self, KeyEncodingError>

Appends a canonical Boolean component.

Source

pub fn push_u32(&mut self, value: u32) -> Result<&mut Self, KeyEncodingError>

Appends an unsigned 32-bit ordered component.

Source

pub fn push_u64(&mut self, value: u64) -> Result<&mut Self, KeyEncodingError>

Appends an unsigned 64-bit ordered component.

Source

pub fn push_i32(&mut self, value: i32) -> Result<&mut Self, KeyEncodingError>

Appends a signed 32-bit component whose bytes preserve numeric order.

Source

pub fn push_i64(&mut self, value: i64) -> Result<&mut Self, KeyEncodingError>

Appends a signed 64-bit component whose bytes preserve numeric order.

Source

pub fn push_timestamp( &mut self, value: Timestamp, ) -> Result<&mut Self, KeyEncodingError>

Appends a canonical timestamp component.

Source

pub fn push_date(&mut self, value: Date) -> Result<&mut Self, KeyEncodingError>

Appends a canonical date component.

Source

pub fn push_enum_variant( &mut self, value: EnumVariantId, ) -> Result<&mut Self, KeyEncodingError>

Appends a canonical declared-enum variant component.

Source

pub fn push_uuid( &mut self, value: &[u8; 16], ) -> Result<&mut Self, KeyEncodingError>

Appends fixed-width UUID network-order bytes.

Source

pub fn push_bytes( &mut self, value: &[u8], ) -> Result<&mut Self, KeyEncodingError>

Appends a length-prefixed exact byte component.

Source

pub fn push_str(&mut self, value: &str) -> Result<&mut Self, KeyEncodingError>

Appends a length-prefixed exact UTF-8 component without normalization.

Source

pub fn push_ordered_bytes( &mut self, value: &[u8], ) -> Result<&mut Self, KeyEncodingError>

Appends zero-escaped bytes whose encoded order preserves byte order.

Source

pub fn push_ordered_bytes_prefix( &mut self, value: &[u8], ) -> Result<&mut Self, KeyEncodingError>

Appends the non-terminated prefix of one ordered-byte component.

Source

pub fn as_bytes(&self) -> &[u8] ⓘ

Returns the currently encoded prefix and components.

Source

pub fn finish(self) -> Result<PartitionKey, KeyEncodingError>

Finishes the bounded canonical logical partition key.

Trait Implementations§

Source§

impl Clone for PartitionKeyBuilder

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PartitionKeyBuilder

Source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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

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

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

Performs the conversion.