pub enum PartitionKey {
String(String),
Int(i64),
Composite(Vec<PartitionKey>),
Uuid(String),
Bytes(Vec<u8>),
}Expand description
A partition key for routing data to shards.
Variants§
String(String)
String key.
Int(i64)
Integer key.
Composite(Vec<PartitionKey>)
Composite key (multiple values).
Uuid(String)
UUID key.
Bytes(Vec<u8>)
Bytes key.
Implementations§
Source§impl PartitionKey
impl PartitionKey
Sourcepub fn composite(keys: Vec<PartitionKey>) -> Self
pub fn composite(keys: Vec<PartitionKey>) -> Self
Create a composite partition key.
Sourcepub fn hash_value(&self) -> u64
pub fn hash_value(&self) -> u64
Compute the hash for this partition key.
Trait Implementations§
Source§impl Clone for PartitionKey
impl Clone for PartitionKey
Source§fn clone(&self) -> PartitionKey
fn clone(&self) -> PartitionKey
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PartitionKey
impl Debug for PartitionKey
Source§impl<'de> Deserialize<'de> for PartitionKey
impl<'de> Deserialize<'de> for PartitionKey
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<&str> for PartitionKey
impl From<&str> for PartitionKey
Source§impl From<String> for PartitionKey
impl From<String> for PartitionKey
Source§impl From<i32> for PartitionKey
impl From<i32> for PartitionKey
Source§impl From<i64> for PartitionKey
impl From<i64> for PartitionKey
Source§impl Hash for PartitionKey
impl Hash for PartitionKey
Source§impl PartialEq for PartitionKey
impl PartialEq for PartitionKey
Source§impl Serialize for PartitionKey
impl Serialize for PartitionKey
impl Eq for PartitionKey
impl StructuralPartialEq for PartitionKey
Auto Trait Implementations§
impl Freeze for PartitionKey
impl RefUnwindSafe for PartitionKey
impl Send for PartitionKey
impl Sync for PartitionKey
impl Unpin for PartitionKey
impl UnsafeUnpin for PartitionKey
impl UnwindSafe for PartitionKey
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.