pub type Key = Value;Expand description
Type alias for map and document keys.
§Purpose
Alias for Value used as keys in map structures. Since Value is used for both
document values and map keys, this type alias provides semantic clarity that a
Value is being used as a key rather than a regular value.
§Characteristics
- Same as Value: Supports all Value types as keys
- Comparable: Implements Ord for key ordering
- Hashable: Implements Hash for use in hash-based structures
- Generic: Works with any Value variant that implements the required traits
§Usage
Used with the key! macro for convenient key creation:
let k = key!("field_name"); // Create a string key
let k = key!(42); // Create an integer keyAliased Type§
pub enum Key {
Show 24 variants
Null,
Bool(bool),
I8(i8),
U8(u8),
I16(i16),
U16(u16),
I32(i32),
U32(u32),
I64(i64),
U64(u64),
I128(i128),
U128(u128),
ISize(isize),
USize(usize),
F32(f32),
F64(f64),
Char(char),
String(String),
Document(Document),
Array(Vec<Value>),
Map(BTreeMap<Value, Value>),
NitriteId(NitriteId),
Bytes(Vec<u8>),
Unknown,
}Variants§
Null
Represents a null value.
Bool(bool)
Represents a boolean value.
I8(i8)
Represents a signed 8-bit integer value.
U8(u8)
Represents an unsigned 8-bit integer value.
I16(i16)
Represents a signed 16-bit integer value.
U16(u16)
Represents an unsigned 16-bit integer value.
I32(i32)
Represents a signed 32-bit integer value.
U32(u32)
Represents an unsigned 32-bit integer value.
I64(i64)
Represents a signed 64-bit integer value.
U64(u64)
Represents an unsigned 64-bit integer value.
I128(i128)
Represents a signed 128-bit integer value.
U128(u128)
Represents an unsigned 128-bit integer value.
ISize(isize)
Represents a signed isize value.
USize(usize)
Represents an unsigned isize value.
F32(f32)
Represents a 32-bit floating point value.
F64(f64)
Represents a 64-bit floating point value.
Char(char)
Represents a character value.
String(String)
Represents a string value.
Document(Document)
Represents a document value.
Array(Vec<Value>)
Represents an array value.
Map(BTreeMap<Value, Value>)
Represents a map.
NitriteId(NitriteId)
Represents a NitriteId value.
Bytes(Vec<u8>)
Represents a byte array value. It will be used for binary data. It cannot be indexed or queried.
Unknown
Represents an unknown value.