Struct key_node_list::KeyNodeList [−][src]
pub struct KeyNodeList<K, N, M = HashMap<K, N>> { /* fields omitted */ }Expand description
A doubly-linked list that stores key-node pairs.
Implementations
Returns a reference to the front key, or None if the list is empty.
This operation should compute in O(1) time.
Returns a reference to the back key, or None if the list is empty.
This operation should compute in O(1) time.
Returns the number of key-node pairs in the list.
This operation should compute in O(1) time.
Returns true if the list contains no key-node pairs.
This operation should compute in O(1) time.
Returns an iterator over all keys and nodes.
The iterator element type is (&'a K, &'a N).
Returns an iterator over all keys.
The iterator element type is &'a K.
Returns true if the linked list contains a node for the specified key.
This operation should compute in O(1) time on average.
Returns a reference to the node corresponding to the key,
or None if key does not exist.
This operation should compute in O(1) time on average.
Returns a mutable reference to the node corresponding to the key,
or None if key does not exist.
This operation should compute in O(1) time on average.
Returns a reference to the front node, or None if the list is empty.
This operation should compute in O(1) time on average.
Returns a mutable reference to the front node,
or None if the list is empty.
This operation should compute in O(1) time on average.
Returns a reference to the back node, or None if the list is empty.
This operation should compute in O(1) time on average.
Returns a mutable reference to the back node,
or None if the list is empty.
This operation should compute in O(1) time on average.
Provides a cursor at the specific key.
The cursor is pointing to the null pair if the key does not exist.
Provides a cursor with editing operations at the specific key.
The cursor is pointing to the null pair if the key does not exist.
Provides a cursor at the front key-node pair.
The cursor is pointing to the null pair if the list is empty.
Provides a cursor with editing operations at the front key-node pair.
The cursor is pointing to the null pair if the list is empty.
Provides a cursor at the back key-node pair.
The cursor is pointing to the null pair if the list is empty.
Provides a cursor with editing operations at the back key-node pair.
The cursor is pointing to the null pair if the list is empty.
Creates a consuming iterator over all keys.
The list cannot be used after calling this.
The iterator element type is K.
Creates a consuming iterator over all nodes.
The list cannot be used after calling this.
The iterator element type is N.
Adds a key-node pair first in the list.
If key already exists, returns an error containing key and node.
This operation should compute in O(1) time on average.
Adds a key-node pair back in the list.
If key already exists, returns an error containing key and node.
This operation should compute in O(1) time on average.
Adds a key first in the list.
If key already exists, returns an error containing key.
This operation should compute in O(1) time on average.
Adds a key back in the list.
If key already exists, returns an error containing key.
This operation should compute in O(1) time on average.
Removes the first key-node pair and returns it, or None if the list
is empty.
This operation should compute in O(1) time on average.
Removes the last key-node pair and returns it, or None if the list
is empty.
This operation should compute in O(1) time on average.
Trait Implementations
Extends a KeyNodeList with an key iterator
if the node can be built with a ().
Example
use key_node_list::KeyValueList;
let mut list: KeyValueList<i32, ()> = KeyValueList::new();
list.extend(&[1, 2, 3]);
assert_eq!(list.front_key(), Some(&1));
assert_eq!(list.back_key(), Some(&3));extend_one)Extends a collection with exactly one element.
extend_one)Reserves capacity in a collection for the given number of additional elements. Read more
Extends a collection with the contents of an iterator. Read more
extend_one)Extends a collection with exactly one element.
extend_one)Reserves capacity in a collection for the given number of additional elements. Read more
Extends a collection with the contents of an iterator. Read more
extend_one)Extends a collection with exactly one element.
extend_one)Reserves capacity in a collection for the given number of additional elements. Read more
Extends a KeyNodeList with an key iterator
if the node can be built with a ().
Example
use key_node_list::KeyValueList;
let mut list: KeyValueList<i32, ()> = KeyValueList::new();
list.extend([1, 2, 3]);
assert_eq!(list.front_key(), Some(&1));
assert_eq!(list.back_key(), Some(&3));extend_one)Extends a collection with exactly one element.
extend_one)Reserves capacity in a collection for the given number of additional elements. Read more
Creates a KeyNodeList from an key iterator
if the node can be built with a ().
Example
use key_node_list::KeyValueList;
let list: KeyValueList<i32, ()> = [1, 2, 3].into_iter().collect();
assert_eq!(list.front_key(), Some(&1));
assert_eq!(list.back_key(), Some(&3));impl<K, N, M> IntoIterator for KeyNodeList<K, N, M> where
K: Hash + Eq + Clone,
N: Node<Key = K>,
M: Map<K, N>,
impl<K, N, M> IntoIterator for KeyNodeList<K, N, M> where
K: Hash + Eq + Clone,
N: Node<Key = K>,
M: Map<K, N>,
impl<'a, K, N, M> IntoIterator for &'a KeyNodeList<K, N, M> where
K: Hash + Eq,
N: Node<Key = K>,
M: Map<K, N>,
impl<'a, K, N, M> IntoIterator for &'a KeyNodeList<K, N, M> where
K: Hash + Eq,
N: Node<Key = K>,
M: Map<K, N>,
Auto Trait Implementations
impl<K, N, M> RefUnwindSafe for KeyNodeList<K, N, M> where
K: RefUnwindSafe,
M: RefUnwindSafe,
N: RefUnwindSafe,
impl<K, N, M> Send for KeyNodeList<K, N, M> where
K: Send,
M: Send,
N: Send,
impl<K, N, M> Sync for KeyNodeList<K, N, M> where
K: Sync,
M: Sync,
N: Sync,
impl<K, N, M> Unpin for KeyNodeList<K, N, M> where
K: Unpin,
M: Unpin,
N: Unpin,
impl<K, N, M> UnwindSafe for KeyNodeList<K, N, M> where
K: UnwindSafe,
M: UnwindSafe,
N: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
