pub enum ShardMode {
Uniform,
Ordered,
}Expand description
How keys are mapped to shards.
Variants§
Uniform
Shard = Fibonacci hash of the key’s leading bytes. Spreads any key distribution (including sequential ids) evenly across shards. Global iteration order is not the key order. Use for lookup tables.
Ordered
Shard = top bits of the key’s leading bytes. Shard index order equals
key order, so Arena::iter yields globally ascending keys and
Arena::range scans work. Keys arriving in a narrow value range
will concentrate in few shards — their chains simply grow longer;
that is the trade-off for ordering.
Trait Implementations§
impl Copy for ShardMode
impl Eq for ShardMode
impl StructuralPartialEq for ShardMode
Auto Trait Implementations§
impl Freeze for ShardMode
impl RefUnwindSafe for ShardMode
impl Send for ShardMode
impl Sync for ShardMode
impl Unpin for ShardMode
impl UnsafeUnpin for ShardMode
impl UnwindSafe for ShardMode
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