pub enum IndexKey {
Null,
Bool(bool),
UnsignedInt(u64),
SignedInt(i64),
Float(u64),
Text(String),
}Expand description
The canonical, deterministic key one indexable JSON scalar maps to.
Determinism here is a correctness requirement, not a nicety: the same value must produce the same key across a process lifetime, a restart, and a rebuild, or a rebuilt index would answer differently from the live one. Every variant is derived from the value’s own contents — never from an address, an iteration order, or a hash seed.
Variants§
Null
Bool(bool)
UnsignedInt(u64)
A serde_json positive integer, which is never equal to a float or a
negative integer even when the arithmetic value would match.
SignedInt(i64)
A serde_json negative integer.
Float(u64)
A finite float, keyed by its bit pattern with -0.0 normalized to 0.0
because -0.0 == 0.0 holds for the predicate too.
Text(String)
Implementations§
Trait Implementations§
impl Eq for IndexKey
Source§impl Ord for IndexKey
impl Ord for IndexKey
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for IndexKey
impl PartialOrd for IndexKey
impl StructuralPartialEq for IndexKey
Auto Trait Implementations§
impl Freeze for IndexKey
impl RefUnwindSafe for IndexKey
impl Send for IndexKey
impl Sync for IndexKey
impl Unpin for IndexKey
impl UnsafeUnpin for IndexKey
impl UnwindSafe for IndexKey
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