pub enum Value {
    Null,
    Opt(Box<Value>),
    Bool(bool),
    Int(i64),
    Uint(u64),
    Float(NotNan<f64>),
    String(String),
    Blob(Vec<u8>),
    Array(Vec<Value>),
    Map(BTreeMap<Value, Value>),
}
Expand description

In-memory, structured representation of a Neodyn Exchange value tree.

Variants

Null

No value (an optional value that is not present).

Opt(Box<Value>)

An optional value that is present.

Bool(bool)

A Boolean value.

Int(i64)

A signed 64-bit integer value.

Uint(u64)

An unsigned 64-bit integer value.

Float(NotNan<f64>)

A 64-bit canonicalized floating-point value that is not NaN.

String(String)

A UTF-8 string value.

Blob(Vec<u8>)

Raw binary data.

Array(Vec<Value>)

An array of Neodyn Exchange values.

Map(BTreeMap<Value, Value>)

A collection of key-value pairs, mapping Values to other Values.

Implementations

Returns the dynamic type tag of this value.

Returns true if and only if this value is null.

Returns true if and only if this value is an Opt containing a value.

Returns true iff this value is either null or an Opt.

Returns true if and only if this value is a bool.

Returns true if and only if this value is a signed integer.

Returns true if and only if this value is an unsigned integer.

Returns true if and only if this value is floating-point.

Returns true if and only if this value is any type of number, i.e. signed integer, unsigned integer, or floating-point.

Returns true if and only if this value is a string.

Returns true if and only if this value is a BLOB.

Returns true if and only if this value is an array.

Returns true if and only if this value is a map.

This only exists for reasons of symmetry.

Borrows the inner value of an optional.

Returns None if self is Null, Some if it’s Opt.

Returns the inner value of an optional, consuming the value.

Returns None if self is Null, Some if it’s Opt.

Returns the boolean value.

Returns the signed integer value.

Returns the unsigned integer value.

Returns the floating-point value.

Borrows the string value.

Mutably borrows the string value.

Returns the string, consuming the value.

Borrows the blob value.

Mutably borrows the blob value.

Returns the blob, consuming the value.

Borrows the array value.

Mutably borrows the array value.

Returns the array, consuming the value.

Borrows the map value.

Mutably borrows the map value.

Returns the map, consuming the value.

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

The default value is null.

Returns the “default value” for a type. Read more

Deserialize this value from the given Serde deserializer. Read more

The actual Deserializer impl.

The error type that can be returned if some error occurs during deserialization. Read more

Determine whether Deserialize implementations should expect to deserialize their human-readable form. Read more

Require the Deserializer to figure out how to drive the visitor based on what data type is in the input. Read more

Hint that the Deserialize type is expecting a bool value.

Hint that the Deserialize type is expecting an i8 value.

Hint that the Deserialize type is expecting an i16 value.

Hint that the Deserialize type is expecting an i32 value.

Hint that the Deserialize type is expecting an i64 value.

Hint that the Deserialize type is expecting an i128 value. Read more

Hint that the Deserialize type is expecting a u8 value.

Hint that the Deserialize type is expecting a u16 value.

Hint that the Deserialize type is expecting a u32 value.

Hint that the Deserialize type is expecting a u64 value.

Hint that the Deserialize type is expecting an u128 value. Read more

Hint that the Deserialize type is expecting a f32 value.

Hint that the Deserialize type is expecting a f64 value.

Hint that the Deserialize type is expecting a char value.

Hint that the Deserialize type is expecting a string value and does not benefit from taking ownership of buffered data owned by the Deserializer. Read more

Hint that the Deserialize type is expecting a string value and would benefit from taking ownership of buffered data owned by the Deserializer. Read more

Hint that the Deserialize type is expecting a byte array and does not benefit from taking ownership of buffered data owned by the Deserializer. Read more

Hint that the Deserialize type is expecting a byte array and would benefit from taking ownership of buffered data owned by the Deserializer. Read more

Hint that the Deserialize type is expecting an optional value. Read more

Hint that the Deserialize type is expecting a unit value.

Hint that the Deserialize type is expecting a unit struct with a particular name. Read more

Hint that the Deserialize type is expecting a newtype struct with a particular name. Read more

Hint that the Deserialize type is expecting a sequence of values.

Hint that the Deserialize type is expecting a sequence of values and knows how many values there are without looking at the serialized data. Read more

Hint that the Deserialize type is expecting a tuple struct with a particular name and number of fields. Read more

Hint that the Deserialize type is expecting a map of key-value pairs.

Hint that the Deserialize type is expecting a struct with a particular name and fields. Read more

Hint that the Deserialize type is expecting an enum value with a particular name and possible variants. Read more

Hint that the Deserialize type is expecting the name of a struct field or the discriminant of an enum variant. Read more

Hint that the Deserialize type needs to deserialize a value whose type doesn’t matter because it is ignored. Read more

The actual Deserializer impl.

The error type that can be returned if some error occurs during deserialization. Read more

Determine whether Deserialize implementations should expect to deserialize their human-readable form. Read more

Require the Deserializer to figure out how to drive the visitor based on what data type is in the input. Read more

Hint that the Deserialize type is expecting a bool value.

Hint that the Deserialize type is expecting an i8 value.

Hint that the Deserialize type is expecting an i16 value.

Hint that the Deserialize type is expecting an i32 value.

Hint that the Deserialize type is expecting an i64 value.

Hint that the Deserialize type is expecting an i128 value. Read more

Hint that the Deserialize type is expecting a u8 value.

Hint that the Deserialize type is expecting a u16 value.

Hint that the Deserialize type is expecting a u32 value.

Hint that the Deserialize type is expecting a u64 value.

Hint that the Deserialize type is expecting an u128 value. Read more

Hint that the Deserialize type is expecting a f32 value.

Hint that the Deserialize type is expecting a f64 value.

Hint that the Deserialize type is expecting a char value.

Hint that the Deserialize type is expecting a string value and does not benefit from taking ownership of buffered data owned by the Deserializer. Read more

Hint that the Deserialize type is expecting a string value and would benefit from taking ownership of buffered data owned by the Deserializer. Read more

Hint that the Deserialize type is expecting a byte array and does not benefit from taking ownership of buffered data owned by the Deserializer. Read more

Hint that the Deserialize type is expecting a byte array and would benefit from taking ownership of buffered data owned by the Deserializer. Read more

Hint that the Deserialize type is expecting an optional value. Read more

Hint that the Deserialize type is expecting a unit value.

Hint that the Deserialize type is expecting a unit struct with a particular name. Read more

Hint that the Deserialize type is expecting a newtype struct with a particular name. Read more

Hint that the Deserialize type is expecting a sequence of values.

Hint that the Deserialize type is expecting a sequence of values and knows how many values there are without looking at the serialized data. Read more

Hint that the Deserialize type is expecting a tuple struct with a particular name and number of fields. Read more

Hint that the Deserialize type is expecting a map of key-value pairs.

Hint that the Deserialize type is expecting a struct with a particular name and fields. Read more

Hint that the Deserialize type is expecting an enum value with a particular name and possible variants. Read more

Hint that the Deserialize type is expecting the name of a struct field or the discriminant of an enum variant. Read more

Hint that the Deserialize type needs to deserialize a value whose type doesn’t matter because it is ignored. Read more

Formats the value using the human-readable text representation.

By default, the value will be pretty-printed. Specifying the alternate flag ({:#}) has the effect of outputting a compact format instead.

Formats the value using the given formatter. Read more

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Creating a Value from unit yields null.

Converts to this type from the input type.

Creates a map.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Creates a map.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

NaN is not permitted in Neodyn Exchange values. It will be converted to Value::Null if it is ever encountered.

Converts to this type from the input type.

NaN is not permitted in Neodyn Exchange values. It will be converted to Value::Null if it is ever encountered.

Converts to this type from the input type.

Converts to this type from the input type.

Creates an array.

Converts to this type from the input type.

Converts to this type from the input type.

Converts a char to a single-character string representation.

Converts to this type from the input type.

NaN is not permitted in Neodyn Exchange values. It will be converted to Value::Null if it is ever encountered.

Converts to this type from the input type.

NaN is not permitted in Neodyn Exchange values. It will be converted to Value::Null if it is ever encountered.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Creates a map from an iterator over key-value pairs.

Creates a value from an iterator. Read more

Creates an array from an iterator over single values.

Creates a value from an iterator. Read more

The associated error which can be returned from parsing.

Parses a string s to return a value of this type. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

The type of the deserializer being converted into.

Convert this value into a deserializer.

The type of the deserializer being converted into.

Convert this value into a deserializer.

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

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

Restrict a value to a certain interval. Read more

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

This method tests for !=.

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

Serialize this value into the given Serde serializer. 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.

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.

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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

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

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.