Enum table::Value[][src]

pub enum Value<'a> {
    Null,
    Bool(bool),
    I64(i64),
    F64(f64),
    Bytes(Box<Cow<'a, [u8]>>),
    String(Box<Cow<'a, str>>),
    List(Box<Cow<'a, List<'a>>>),
    Table(Box<Cow<'a, Table<'a>>>),
}

Defines the types of data that can be stored in a table.

Variants

A type with a single value; also called nil or unit. Can be used to indicate presence of a key but absence of a significant value.

A type with two values, true and false.

A signed 64-bit integer type.

A floating-point type with 64-bit precision.

A slice of bytes wrapped with a clone-on-write container.

A UTF-8 string wrapped with a clone-on-write container.

A nested list wrapped with a clone-on-write container.

A nested table wrapped with a clone-on-write container.

Methods

impl<'a> Value<'a>
[src]

Serializes the given value into a Value.

Examples

use table::Value;

assert_eq!(Value::serialize(&328), Ok(Value::I64(328)));

Deserializes the referenced Value into a value of another type.

Examples

use table::Value;

assert_eq!(Value::Bool(false).deserialize(), Ok(false));

Deserializes the Value into a value of another type, consuming the Value and taking ownership to avoid copying buffers.

Examples

use table::Value;

assert_eq!(Value::Null.deserialize_into(), Ok(()));

Trait Implementations

impl<'a> Debug for Value<'a>
[src]

Formats the value using the given formatter. Read more

impl<'a> Clone for Value<'a>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<'a> PartialEq for Value<'a>
[src]

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

This method tests for !=.

impl<'a> From<bool> for Value<'a>
[src]

Performs the conversion.

impl<'a> TryAsRef<bool> for Value<'a>
[src]

Attempt to unwrap the inner reference.

impl<'a> TryAsMut<bool> for Value<'a>
[src]

Attempt to unwrap the inner reference.

impl<'a> From<i64> for Value<'a>
[src]

Performs the conversion.

impl<'a> TryAsRef<i64> for Value<'a>
[src]

Attempt to unwrap the inner reference.

impl<'a> TryAsMut<i64> for Value<'a>
[src]

Attempt to unwrap the inner reference.

impl<'a> From<f64> for Value<'a>
[src]

Performs the conversion.

impl<'a> TryAsRef<f64> for Value<'a>
[src]

Attempt to unwrap the inner reference.

impl<'a> TryAsMut<f64> for Value<'a>
[src]

Attempt to unwrap the inner reference.

impl<'a> From<Box<Cow<'a, [u8]>>> for Value<'a>
[src]

Performs the conversion.

impl<'a> TryAsRef<Box<Cow<'a, [u8]>>> for Value<'a>
[src]

Attempt to unwrap the inner reference.

impl<'a> TryAsMut<Box<Cow<'a, [u8]>>> for Value<'a>
[src]

Attempt to unwrap the inner reference.

impl<'a> From<Box<Cow<'a, str>>> for Value<'a>
[src]

Performs the conversion.

impl<'a> TryAsRef<Box<Cow<'a, str>>> for Value<'a>
[src]

Attempt to unwrap the inner reference.

impl<'a> TryAsMut<Box<Cow<'a, str>>> for Value<'a>
[src]

Attempt to unwrap the inner reference.

impl<'a> From<Box<Cow<'a, List<'a>>>> for Value<'a>
[src]

Performs the conversion.

impl<'a> TryAsRef<Box<Cow<'a, List<'a>>>> for Value<'a>
[src]

Attempt to unwrap the inner reference.

impl<'a> TryAsMut<Box<Cow<'a, List<'a>>>> for Value<'a>
[src]

Attempt to unwrap the inner reference.

impl<'a> From<Box<Cow<'a, Table<'a>>>> for Value<'a>
[src]

Performs the conversion.

impl<'a> TryAsRef<Box<Cow<'a, Table<'a>>>> for Value<'a>
[src]

Attempt to unwrap the inner reference.

impl<'a> TryAsMut<Box<Cow<'a, Table<'a>>>> for Value<'a>
[src]

Attempt to unwrap the inner reference.

impl<'a> From<i8> for Value<'a>
[src]

Performs the conversion.

impl<'a> From<i16> for Value<'a>
[src]

Performs the conversion.

impl<'a> From<i32> for Value<'a>
[src]

Performs the conversion.

impl<'a> From<u8> for Value<'a>
[src]

Performs the conversion.

impl<'a> From<u16> for Value<'a>
[src]

Performs the conversion.

impl<'a> From<u32> for Value<'a>
[src]

Performs the conversion.

impl<'a> From<u64> for Value<'a>
[src]

Performs the conversion.

impl<'a> From<isize> for Value<'a>
[src]

Performs the conversion.

impl<'a> From<usize> for Value<'a>
[src]

Performs the conversion.

impl<'a> From<f32> for Value<'a>
[src]

Performs the conversion.

impl<'a> From<Cow<'a, [u8]>> for Value<'a>
[src]

Performs the conversion.

impl<'a> TryAsRef<Cow<'a, [u8]>> for Value<'a>
[src]

Attempt to unwrap the inner reference.

impl<'a> TryAsMut<Cow<'a, [u8]>> for Value<'a>
[src]

Attempt to unwrap the inner reference.

impl<'a> From<Cow<'a, str>> for Value<'a>
[src]

Performs the conversion.

impl<'a> TryAsRef<Cow<'a, str>> for Value<'a>
[src]

Attempt to unwrap the inner reference.

impl<'a> TryAsMut<Cow<'a, str>> for Value<'a>
[src]

Attempt to unwrap the inner reference.

impl<'a> From<Cow<'a, List<'a>>> for Value<'a>
[src]

Performs the conversion.

impl<'a> TryAsRef<Cow<'a, List<'a>>> for Value<'a>
[src]

Attempt to unwrap the inner reference.

impl<'a> TryAsMut<Cow<'a, List<'a>>> for Value<'a>
[src]

Attempt to unwrap the inner reference.

impl<'a> From<Cow<'a, Table<'a>>> for Value<'a>
[src]

Performs the conversion.

impl<'a> TryAsRef<Cow<'a, Table<'a>>> for Value<'a>
[src]

Attempt to unwrap the inner reference.

impl<'a> TryAsMut<Cow<'a, Table<'a>>> for Value<'a>
[src]

Attempt to unwrap the inner reference.

impl<'a> From<&'a [u8]> for Value<'a>
[src]

Performs the conversion.

impl<'a> From<Vec<u8>> for Value<'a>
[src]

Performs the conversion.

impl<'a> TryAsRef<[u8]> for Value<'a>
[src]

Attempt to unwrap the inner reference.

impl<'a> TryAsMut<Vec<u8>> for Value<'a>
[src]

Attempt to unwrap the inner reference.

impl<'a> From<&'a str> for Value<'a>
[src]

Performs the conversion.

impl<'a> From<String> for Value<'a>
[src]

Performs the conversion.

impl<'a> TryAsRef<str> for Value<'a>
[src]

Attempt to unwrap the inner reference.

impl<'a> TryAsMut<String> for Value<'a>
[src]

Attempt to unwrap the inner reference.

impl<'a> From<&'a List<'a>> for Value<'a>
[src]

Performs the conversion.

impl<'a> From<List<'a>> for Value<'a>
[src]

Performs the conversion.

impl<'a> TryAsRef<List<'a>> for Value<'a>
[src]

Attempt to unwrap the inner reference.

impl<'a> TryAsMut<List<'a>> for Value<'a>
[src]

Attempt to unwrap the inner reference.

impl<'a> From<&'a Table<'a>> for Value<'a>
[src]

Performs the conversion.

impl<'a> From<Table<'a>> for Value<'a>
[src]

Performs the conversion.

impl<'a> TryAsRef<Table<'a>> for Value<'a>
[src]

Attempt to unwrap the inner reference.

impl<'a> TryAsMut<Table<'a>> for Value<'a>
[src]

Attempt to unwrap the inner reference.

impl<'a> Default for Value<'a>
[src]

Returns the "default value" for a type. Read more

impl<'a> AsRef<Value<'a>> for Value<'a>
[src]

Performs the conversion.

impl<'a> AsMut<Value<'a>> for Value<'a>
[src]

Performs the conversion.

impl<'a> PartialOrd for Value<'a>
[src]

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

impl<'a> Serialize for Value<'a>
[src]

Serialize this value into the given Serde serializer. Read more

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

Deserialize this value from the given Serde deserializer. Read more

impl<'a, 'b> From<&'b Value<'a>> for Unexpected<'b>
[src]

Performs the conversion.

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

The error type that can be returned if some error occurs during deserialization. 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 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 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 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 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 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 a tuple struct with a particular name and number of fields. 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

Hint that the Deserialize type is expecting an optional value. 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 an enum value with a particular name and possible variants. Read more

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

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

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

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

The error type that can be returned if some error occurs during deserialization. Must match the error type of our EnumAccess. Read more

Called when deserializing a variant with no values. Read more

Called when deserializing a variant with a single value. Read more

Called when deserializing a tuple-like variant. Read more

Called when deserializing a struct-like variant. Read more

Called when deserializing a variant with a single value. Read more

impl<'de: 'a, 'a> Deserializer<'de> for &'de Value<'a>
[src]

The error type that can be returned if some error occurs during deserialization. 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 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 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 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 sequence of values.

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

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 struct with a particular name and fields. 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

Hint that the Deserialize type is expecting an optional value. 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 an enum value with a particular name and possible variants. Read more

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

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

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

impl<'de: 'a, 'a> VariantAccess<'de> for &'de Value<'a>
[src]

The error type that can be returned if some error occurs during deserialization. Must match the error type of our EnumAccess. Read more

Called when deserializing a variant with no values. Read more

Called when deserializing a variant with a single value. Read more

Called when deserializing a tuple-like variant. Read more

Called when deserializing a struct-like variant. Read more

Called when deserializing a variant with a single value. Read more

Auto Trait Implementations

impl<'a> Send for Value<'a>

impl<'a> Sync for Value<'a>