[−][src]Enum serde_pickle::value::HashableValue
Represents all primitive builtin Python values that can be contained in a "hashable" context (i.e., as dictionary keys and set elements).
In Rust, the type is not hashable, since we use B-tree maps and sets instead of the hash variants. To be able to put all Value instances into these B-trees, we implement a consistent ordering between all the possible types (see below).
Variants
None
Bool(bool)
Boolean
I64(i64)
Short integer
Int(BigInt)
Long integer
F64(f64)
Float
Bytestring
String(String)
Unicode string
Tuple(Vec<HashableValue>)
Tuple
FrozenSet(BTreeSet<HashableValue>)
Frozen (immutable) set
Methods
impl HashableValue
[src]
pub fn into_value(self) -> Value
[src]
Convert the value into its non-hashable version. This always works.
Trait Implementations
impl Clone for HashableValue
[src]
fn clone(&self) -> HashableValue
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for HashableValue
[src]
impl<'de> Deserialize<'de> for HashableValue
[src]
fn deserialize<D: Deserializer<'de>>(
deser: D
) -> StdResult<HashableValue, D::Error>
[src]
deser: D
) -> StdResult<HashableValue, D::Error>
impl Display for HashableValue
[src]
impl Eq for HashableValue
[src]
impl Ord for HashableValue
[src]
Implement a (more or less) consistent ordering for HashableValue
s
so that they can be added to dictionaries and sets.
Also, like in Python, numeric values with the same value (integral or not) must compare equal.
For other types, we define an ordering between all types A and B so that all objects of type A are always lesser than objects of type B. This is done similar to Python 2's ordering of different types.
fn cmp(&self, other: &HashableValue) -> Ordering
[src]
fn max(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
1.21.0[src]
fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<HashableValue> for HashableValue
[src]
fn eq(&self, other: &HashableValue) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<HashableValue> for HashableValue
[src]
Auto Trait Implementations
impl RefUnwindSafe for HashableValue
impl Send for HashableValue
impl Sync for HashableValue
impl Unpin for HashableValue
impl UnwindSafe for HashableValue
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,