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
Trait Implementations
sourceimpl<'de> IntoDeserializer<'de, Error> for &'de Node<&'de str>
impl<'de> IntoDeserializer<'de, Error> for &'de Node<&'de str>
type Deserializer = NodeDeserializer<'de, &'de str>
type Deserializer = NodeDeserializer<'de, &'de str>
The type of the deserializer being converted into.
sourcefn into_deserializer(self) -> Self::Deserializer
fn into_deserializer(self) -> Self::Deserializer
Convert this value into a deserializer.
sourceimpl<'de> IntoDeserializer<'de, Error> for &'de Node<EntryData<'de>>
impl<'de> IntoDeserializer<'de, Error> for &'de Node<EntryData<'de>>
type Deserializer = NodeDeserializer<'de, EntryData<'de>>
type Deserializer = NodeDeserializer<'de, EntryData<'de>>
The type of the deserializer being converted into.
sourcefn into_deserializer(self) -> Self::Deserializer
fn into_deserializer(self) -> Self::Deserializer
Convert this value into a deserializer.
impl<T: Eq> Eq for Node<T>
impl<T> StructuralEq for Node<T>
impl<T> StructuralPartialEq for Node<T>
Auto Trait Implementations
impl<T> RefUnwindSafe for Node<T> where
T: RefUnwindSafe,
impl<T> Send for Node<T> where
T: Send,
impl<T> Sync for Node<T> where
T: Sync,
impl<T> Unpin for Node<T> where
T: Unpin,
impl<T> UnwindSafe for Node<T> where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.