pub enum CanonicalKey {
Atom(&'static str),
Bool(&'static str, bool),
Bytes(&'static str, Vec<u8>),
String(&'static str, String),
Symbol(&'static str, Symbol),
Pair(&'static str, String, String),
Compound(&'static str, Vec<CanonicalKey>),
CompoundNamed(&'static str, Vec<(String, CanonicalKey)>),
}Expand description
A normalized, comparable key derived from an Expr.
Backs canonical equality and hashing: structurally equal expressions (modulo map/set ordering) produce equal keys. Each variant tags its shape with a static label so unlike shapes never collide.
Variants§
Atom(&'static str)
A tagged atom with no payload.
Bool(&'static str, bool)
A tagged boolean.
Bytes(&'static str, Vec<u8>)
Tagged raw bytes.
String(&'static str, String)
A tagged string.
Symbol(&'static str, Symbol)
A tagged symbol.
Pair(&'static str, String, String)
A tagged pair of strings.
Compound(&'static str, Vec<CanonicalKey>)
A tagged ordered sequence of sub-keys.
CompoundNamed(&'static str, Vec<(String, CanonicalKey)>)
A tagged sequence of name/sub-key pairs.
Trait Implementations§
Source§impl Clone for CanonicalKey
impl Clone for CanonicalKey
Source§fn clone(&self) -> CanonicalKey
fn clone(&self) -> CanonicalKey
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CanonicalKey
impl Debug for CanonicalKey
impl Eq for CanonicalKey
Source§impl Hash for CanonicalKey
impl Hash for CanonicalKey
Source§impl Ord for CanonicalKey
impl Ord for CanonicalKey
Source§fn cmp(&self, other: &CanonicalKey) -> Ordering
fn cmp(&self, other: &CanonicalKey) -> Ordering
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
Source§impl PartialEq for CanonicalKey
impl PartialEq for CanonicalKey
Source§fn eq(&self, other: &CanonicalKey) -> bool
fn eq(&self, other: &CanonicalKey) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for CanonicalKey
impl PartialOrd for CanonicalKey
impl StructuralPartialEq for CanonicalKey
Auto Trait Implementations§
impl Freeze for CanonicalKey
impl RefUnwindSafe for CanonicalKey
impl Send for CanonicalKey
impl Sync for CanonicalKey
impl Unpin for CanonicalKey
impl UnsafeUnpin for CanonicalKey
impl UnwindSafe for CanonicalKey
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