[−][src]Enum listinfo::Node
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
A uniquely keyed node (only one of such key exists in the entry)
Many(Vec<T>)
Multiple nodes with the same key.
Implementations
impl<'a, T> Node<T>
[src]
pub fn iter(&'a self) -> NodeIter<'a, T>
[src]
Gets the values with the given key.
If the provided key is a unique value, returns an iterator that yields that single value.
pub fn unique(&'a self) -> &T
[src]
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
impl<T: Debug> Debug for Node<T>
[src]
impl<T: Eq> Eq for Node<T>
[src]
impl<'de> IntoDeserializer<'de, Error> for &'de Node<&'de str>
[src]
type Deserializer = NodeDeserializer<'de, &'de str>
The type of the deserializer being converted into.
fn into_deserializer(self) -> Self::Deserializer
[src]
impl<'de> IntoDeserializer<'de, Error> for &'de Node<EntryData<'de>>
[src]
type Deserializer = NodeDeserializer<'de, EntryData<'de>>
The type of the deserializer being converted into.
fn into_deserializer(self) -> Self::Deserializer
[src]
impl<T: PartialEq> PartialEq<Node<T>> for Node<T>
[src]
impl<T> StructuralEq for Node<T>
[src]
impl<T> StructuralPartialEq for Node<T>
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for Node<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for Node<T> where
T: Send,
T: Send,
impl<T> Sync for Node<T> where
T: Sync,
T: Sync,
impl<T> Unpin for Node<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for Node<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
fn equivalent(&self, key: &K) -> bool
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,