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

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

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<HashableValue, Value>)

Dictionary (map)

Methods

impl Value[src]

pub fn into_hashable(self) -> Result<HashableValue, Error>[src]

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

Trait Implementations

impl PartialEq<Value> for Value[src]

impl Clone for Value[src]

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

Performs copy-assignment from source. Read more

impl Display for Value[src]

impl Debug for Value[src]

impl<'de> Deserialize<'de> for Value[src]

Auto Trait Implementations

impl Send for Value

impl Sync for Value

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]