Enum serde_pickle::value::Value[][src]

pub enum Value {
    None,
    Bool(bool),
    I64(i64),
    Int(BigInt),
    F64(f64),
    Bytes(Vec<u8>),
    String(String),
    List(Vec<Value>),
    Tuple(Vec<Value>),
    Set(BTreeSet<HashableValue>),
    FrozenSet(BTreeSet<HashableValue>),
    Dict(BTreeMap<HashableValue, Value>),
}
Expand description

Represents all primitive builtin Python values that can be restored by unpickling.

Note on integers: the distinction between the two types (short and long) is very fuzzy in Python, and they can be used interchangeably. In Python 3, all integers are long integers, so all are pickled as such. While decoding, we simply put all integers that fit into an i64, and use BigInt for the rest.

Variants

None

None

Bool(bool)

Boolean

Tuple Fields of Bool

0: bool
I64(i64)

Short integer

Tuple Fields of I64

0: i64
Int(BigInt)

Long integer (unbounded length)

Tuple Fields of Int

0: BigInt
F64(f64)

Float

Tuple Fields of F64

0: f64
Bytes(Vec<u8>)

Bytestring

Tuple Fields of Bytes

0: Vec<u8>
String(String)

Unicode string

Tuple Fields of String

0: String
List(Vec<Value>)

List

Tuple Fields of List

0: Vec<Value>
Tuple(Vec<Value>)

Tuple

Tuple Fields of Tuple

0: Vec<Value>

Set

Tuple Fields of Set

0: BTreeSet<HashableValue>

Frozen (immutable) set

Tuple Fields of FrozenSet

0: BTreeSet<HashableValue>

Dictionary (map)

Tuple Fields of Dict

0: BTreeMap<HashableValue, Value>

Implementations

Convert the value into a hashable version, if possible. If not, return a ValueNotHashable error.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

Formats the value using the given formatter. Read more

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

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.