pub struct HashableExpr<'a>(/* private fields */);Expand description
Wrapper around Expr that implements Hash and PartialEq according to Python
semantics:
Values that compare equal (such as 1, 1.0, and True) can be used interchangeably to index the same dictionary entry.
For example, considers True, 1, and 1.0 to be equal, as they hash to the same value
in Python, along with False, 0, and 0.0.
See: https://docs.python.org/3/library/stdtypes.html#mapping-types-dict
Trait Implementations§
Source§impl<'a> Debug for HashableExpr<'a>
impl<'a> Debug for HashableExpr<'a>
Source§impl<'a> From<&'a Expr> for HashableExpr<'a>
impl<'a> From<&'a Expr> for HashableExpr<'a>
Source§fn from(expr: &'a Expr) -> HashableExpr<'a>
fn from(expr: &'a Expr) -> HashableExpr<'a>
Converts to this type from the input type.
Source§impl Hash for HashableExpr<'_>
impl Hash for HashableExpr<'_>
Source§impl PartialEq for HashableExpr<'_>
impl PartialEq for HashableExpr<'_>
impl Eq for HashableExpr<'_>
Auto Trait Implementations§
impl<'a> Freeze for HashableExpr<'a>
impl<'a> RefUnwindSafe for HashableExpr<'a>
impl<'a> Send for HashableExpr<'a>
impl<'a> Sync for HashableExpr<'a>
impl<'a> Unpin for HashableExpr<'a>
impl<'a> UnsafeUnpin for HashableExpr<'a>
impl<'a> UnwindSafe for HashableExpr<'a>
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<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.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more