pub enum ObjectKey {
Number(BigInt),
String(String),
Tuple(Tuple<ObjectKey>),
}Expand description
Key-comparable value which implements Eq and Hash.
Eure restricts map keys to three types — String, Number (BigInt),
and Tuple<ObjectKey> — for practical and predictable behavior.
-
Deterministic equality: These types provide stable, well-defined equality and hashing. Types like floats, null, or holes introduce ambiguous or platform-dependent comparison rules.
-
Reliable round-tripping: Keys must serialize and deserialize without losing meaning. Strings, integers, and tuples have canonical and unambiguous textual forms.
-
Tooling-friendly: This set balances expressiveness and simplicity, making keys easy to validate, index, and reason about across implementations.
Note: In key position, true, false, and null are parsed as string
identifiers, not as boolean/null values. For example, a.true = true
creates a key "true" with boolean value true.
Variants§
Trait Implementations§
Source§impl Ord for ObjectKey
impl Ord for ObjectKey
Source§impl ParseObjectKey<'_> for ObjectKey
impl ParseObjectKey<'_> for ObjectKey
Source§fn from_object_key(key: &ObjectKey) -> Result<Self, ParseErrorKind>
fn from_object_key(key: &ObjectKey) -> Result<Self, ParseErrorKind>
Source§fn from_extension_ident(ident: &Identifier) -> Result<Self, ParseErrorKind>
fn from_extension_ident(ident: &Identifier) -> Result<Self, ParseErrorKind>
Source§impl<'doc> ParseObjectKey<'doc> for &'doc ObjectKey
impl<'doc> ParseObjectKey<'doc> for &'doc ObjectKey
Source§fn from_object_key(key: &'doc ObjectKey) -> Result<Self, ParseErrorKind>
fn from_object_key(key: &'doc ObjectKey) -> Result<Self, ParseErrorKind>
Source§fn from_extension_ident(_ident: &Identifier) -> Result<Self, ParseErrorKind>
fn from_extension_ident(_ident: &Identifier) -> Result<Self, ParseErrorKind>
Source§impl PartialOrd for ObjectKey
impl PartialOrd for ObjectKey
impl Eq for ObjectKey
impl StructuralPartialEq for ObjectKey
Auto Trait Implementations§
impl Freeze for ObjectKey
impl RefUnwindSafe for ObjectKey
impl Send for ObjectKey
impl Sync for ObjectKey
impl Unpin for ObjectKey
impl UnwindSafe for ObjectKey
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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
key and return true if they are equal.