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<HashableValueValue>),
}

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

I64(i64)

Short integer

Int(BigInt)

Long integer (unbounded length)

F64(f64)

Float

Bytes(Vec<u8>)

Bytestring

String(String)

Unicode string

List(Vec<Value>)

List

Tuple(Vec<Value>)

Tuple

Set(BTreeSet<HashableValue>)

Set

FrozenSet(BTreeSet<HashableValue>)

Frozen (immutable) set

Dict(BTreeMap<HashableValueValue>)

Dictionary (map)

Methods

impl Value
[src]

fn into_hashable(self) -> Result<HashableValueError>

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

Trait Implementations

impl PartialEq for Value
[src]

fn eq(&self, __arg_0: &Value) -> bool

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

fn ne(&self, __arg_0: &Value) -> bool

This method tests for !=.

impl Debug for Value
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.

impl Clone for Value
[src]

fn clone(&self) -> Value

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)
1.0.0

Performs copy-assignment from source. Read more

impl Display for Value
[src]

fn fmt(&self, f: &mut Formatter) -> Result

Formats the value using the given formatter.

impl Deserialize for Value
[src]

fn deserialize<D>(deser: &mut D) -> StdResult<Value, D::Error> where D: Deserializer

Deserialize this value given this Deserializer.