[][src]Enum packs::value::Value

pub enum Value<S> {
    Null,
    Boolean(bool),
    Integer(i64),
    Float(f64),
    Bytes(Bytes),
    String(String),
    List(Vec<Value<S>>),
    Dictionary(HashMap<String, Value<S>>),
    Structure(S),
}

A type for all possible values which can be serialized through PackStream. This type abstracts over structure types, which allows the user to define their own structures which should be part of Value. There are two standard implementations, either Value<()> to denote a value where only the unit is allowed as a structure, or Value<GenericStruct> which reads any valid structure in a generic way, see GenericStruct.

Variants

Null
Boolean(bool)
Integer(i64)
Float(f64)
Bytes(Bytes)
String(String)
List(Vec<Value<S>>)
Dictionary(HashMap<String, Value<S>>)
Structure(S)

Trait Implementations

impl<S: Clone> Clone for Value<S>[src]

impl<S: Debug> Debug for Value<S>[src]

impl<S, '_> From<&'_ str> for Value<S>[src]

impl<S> From<String> for Value<S>[src]

impl<S> From<bool> for Value<S>[src]

impl<S> From<f64> for Value<S>[src]

impl<S> From<i64> for Value<S>[src]

impl<T: Write, S: PackableStructSum> Pack<T> for Value<S>[src]

impl<S: PartialEq> PartialEq<Value<S>> for Value<S>[src]

impl<S> StructuralPartialEq for Value<S>[src]

impl<T: Read, S: PackableStructSum> Unpack<T> for Value<S>[src]

Auto Trait Implementations

impl<S> RefUnwindSafe for Value<S> where
    S: RefUnwindSafe

impl<S> Send for Value<S> where
    S: Send

impl<S> Sync for Value<S> where
    S: Sync

impl<S> Unpin for Value<S> where
    S: Unpin

impl<S> UnwindSafe for Value<S> where
    S: UnwindSafe

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

impl<S, T> Pack<T> for S where
    S: PackableStructSum,
    T: Write
[src]

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

type Owned = T

The resulting type after obtaining ownership.

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

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> 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<S, T> Unpack<T> for S where
    S: PackableStructSum,
    T: Read
[src]