pub enum Node<T> {
    Unique(T),
    Many(Vec<T>),
}
Expand description

Represents nodes with the given key in an ListInfo entry.

The split between Unique and Many is mostly for performance reasons to avoid unnecessary allocations. Node::Unique appeared exactly once in the parsed DAT file, while Node::Unique appeared more than once.

Instead of accessing the enum members directly, the Node::iter and Node::unique methods abstract over the difference between Unique and Many for convenience.

Variants

Unique(T)

A uniquely keyed node (only one of such key exists in the entry)

Many(Vec<T>)

Multiple nodes with the same key.

Implementations

Gets the values with the given key.

If the provided key is a unique value, returns an iterator that yields that single value.

Gets a single value with the given key.

If the provided key is not unique, retrieves the first value of the many-set with the given key.

Trait Implementations

Formats the value using the given formatter. 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 tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

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

Compare self to key and return true if they are equal.

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 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.