pub enum Item {
    None,
    Value(Value),
    Table(Table),
    ArrayOfTables(ArrayOfTables),
}
Expand description

Type representing either a value, a table, an array of tables, or none.

Variants

None

Type representing none.

Value(Value)

Type representing value.

Table(Table)

Type representing table.

ArrayOfTables(ArrayOfTables)

Type representing array of tables.

Implementations

Sets self to the given item iff self is none and returns a mutable reference to self.

Downcasting

Text description of value type

Index into a TOML array or map. A string index can be used to access a value in a map, and a usize index can be used to access an element of an array.

Returns None if:

  • The type of self does not match the type of the index, for example if the index is a string and self is an array or a number.
  • The given key does not exist in the map or the given index is not within the bounds of the array.

Mutably index into a TOML array or map. A string index can be used to access a value in a map, and a usize index can be used to access an element of an array.

Returns None if:

  • The type of self does not match the type of the index, for example if the index is a string and self is an array or a number.
  • The given key does not exist in the map or the given index is not within the bounds of the array.

Casts self to value.

Casts self to table.

Casts self to array of tables.

Casts self to mutable value.

Casts self to mutable table.

Casts self to mutable array of tables.

Casts self to value.

In-place convert to a value

Casts self to table.

Casts self to array of tables.

Returns true iff self is a value.

Returns true iff self is a table.

Returns true iff self is an array of tables.

Returns true iff self is None.

Casts self to integer.

Returns true iff self is an integer.

Casts self to float.

Returns true iff self is a float.

Casts self to boolean.

Returns true iff self is a boolean.

Casts self to str.

Returns true iff self is a string.

Casts self to date-time.

Returns true iff self is a date-time.

Casts self to array.

Casts self to mutable array.

Returns true iff self is an array.

Casts self to inline table.

Casts self to mutable inline table.

Returns true iff self is an inline table.

Casts self to either a table or an inline table.

Casts self to either a table or an inline table.

Returns true iff self is either a table, or an inline table.

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

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

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 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 a bool 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 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 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 sequence of values.

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 map of key-value pairs.

Hint that the Deserialize type is expecting a unit value.

Hint that the Deserialize type is expecting a struct with a particular name and fields. 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 a unit struct with a particular name. 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 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 the name of a struct field or the discriminant of an enum variant. 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

Formats the value using the given formatter. Read more

Parses a value from a &str

The associated error which can be returned from parsing.

The returned type after indexing.

Performs the indexing (container[index]) operation. Read more

Performs the mutable indexing (container[index]) operation. Read more

The type of the deserializer being converted into.

Convert this value into a deserializer.

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.