pub enum DistinctKey {
Null,
Bool(bool),
Int(i64),
Real(u64),
Text(String),
Vector(Vec<u8>),
}Expand description
A hashable typed wrapper around Value, used as the GROUP BY key
element and as the COUNT(DISTINCT col) set entry. We can’t impl Hash for Value because Value has a Real(f64) variant and f64
isn’t Hash + Eq. Round-trip via f64::to_bits to keep the
canonical bit-pattern as the key — NaN keys remain distinguishable
by exact bit pattern, which is the safer choice for grouping (we
don’t try to be cute about NaN==NaN).
Variants§
Implementations§
Source§impl DistinctKey
impl DistinctKey
pub fn from_value(v: &Value) -> Self
Trait Implementations§
Source§impl Clone for DistinctKey
impl Clone for DistinctKey
Source§fn clone(&self) -> DistinctKey
fn clone(&self) -> DistinctKey
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 DistinctKey
impl Debug for DistinctKey
Source§impl Hash for DistinctKey
impl Hash for DistinctKey
Source§impl PartialEq for DistinctKey
impl PartialEq for DistinctKey
Source§fn eq(&self, other: &DistinctKey) -> bool
fn eq(&self, other: &DistinctKey) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for DistinctKey
impl StructuralPartialEq for DistinctKey
Auto Trait Implementations§
impl Freeze for DistinctKey
impl RefUnwindSafe for DistinctKey
impl Send for DistinctKey
impl Sync for DistinctKey
impl Unpin for DistinctKey
impl UnsafeUnpin for DistinctKey
impl UnwindSafe for DistinctKey
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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
Compare self to
key and return true if they are equal.