Skip to main content

Crate use_partition_key

Crate use_partition_key 

Source
Expand description

§use-partition-key

Partition and routing key primitives for RustUse.

§Experimental

use-partition-key is experimental while use-nosql remains below 0.3.0.

§Example

use use_partition_key::{CompositeKey, PartitionKey, PartitionStrategy};

let key = CompositeKey::new()
    .with_part(PartitionKey::new("tenant_1"))
    .with_part(PartitionKey::new("customer_1"));

assert_eq!(key.parts().len(), 2);
assert_eq!(PartitionStrategy::Hash.to_string(), "hash");

§Scope

  • Partition, shard, routing, sort, and composite key labels.
  • Partition strategy descriptors.

§Non-goals

  • Hashing implementations.
  • Cluster topology management.
  • Vendor-specific routing algorithms.

§License

Licensed under either Apache-2.0 or MIT.

Structs§

CompositeKey
A composite partitioning key.
PartitionKey
A reusable partition key.
RoutingKey
A routing key.
ShardKey
A shard key.
SortKey
A sort key.

Enums§

PartitionStrategy
Partition strategy labels.