Enum serde_pickle::value::HashableValue [] [src]

pub enum HashableValue {
    None,
    Bool(bool),
    I64(i64),
    Int(BigInt),
    F64(f64),
    Bytes(Vec<u8>),
    String(String),
    Tuple(Vec<HashableValue>),
    FrozenSet(BTreeSet<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

Boolean

Short integer

Long integer

Float

Bytestring

Unicode string

Tuple

Frozen (immutable) set

Methods

impl HashableValue
[src]

Convert the value into its non-hashable version. This always works.

Trait Implementations

impl Clone for HashableValue
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for HashableValue
[src]

Formats the value using the given formatter.

impl Display for HashableValue
[src]

Formats the value using the given formatter.

impl PartialEq for HashableValue
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Eq for HashableValue
[src]

impl PartialOrd for HashableValue
[src]

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl Ord for HashableValue
[src]

Implement a (more or less) consistent ordering for HashableValues 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.

This method returns an Ordering between self and other. Read more

impl Deserialize for HashableValue
[src]

Deserialize this value from the given Serde deserializer. Read more