Lines Matching refs:list
20 /// Linked list implementation, provides two sets of methods for getting nodes and members.
40 /// Gets length of the list.
46 /// Determines whether the linked list is empty.
52 /// Inserts an element at the end of the list
72 /// Pops an element from the end of the list.
93 /// Gets an ordinary iterator for a linked list.
104 /// Gets a mutable iterator for the linked list.
115 /// Gets the normal cursor of the list and sets the starting point to the list header.
121 list: self,
125 /// Gets the variable cursor of the list and sets the starting point to the list header.
131 list: self,
135 /// Gets the normal cursor of the list and sets the starting point to the end of the list.
142 list: self,
146 /// Gets the variable cursor of the list and sets the start to the end of the list.
153 list: self,
157 /// Gets a mutable reference to the tail element of the list.
168 /// Gets a mutable reference to the tail element of the list.
178 /// Gets a common reference to the node at the end of the linked list.
189 /// Gets a mutable reference to the node at the end of the linked list.
205 /// Removes a node from the linked list.
276 // However, when using this list, locking is still required under concurrent conditions.
280 /// Linked list node, only through a linked list cursor to get the node.
289 /// Creates a linked list node.
299 /// Retrieves the member inside the list node.
304 /// Gets a common reference to an internal member of a linked list node.
309 /// Removes the node itself from the linked list and returns the member below.
312 let list = unsafe { &mut *(self.parent as *mut LinkedList<T>) };
316 list,
322 /// A common iterator of a linked list.
371 /// A variable iterator of a linked list.
421 /// A common cursor for a linked list. When the list is empty,
426 list: &'a LinkedList<T>,
444 self.current = self.list.head;
457 self.current = self.list.tail;
458 self.index = self.list.len().saturating_sub(1);
461 self.index = self.index.checked_sub(1).unwrap_or_else(|| self.list.len());
495 list: &'a mut LinkedList<T>,
512 self.current = self.list.head;
525 self.current = self.list.tail;
526 self.index = self.list.len().saturating_sub(1);
529 self.index = self.index.checked_sub(1).unwrap_or_else(|| self.list.len());
552 node.parent = self.list as *mut LinkedList<T>;
568 self.list.unlink_node(unlinked_node);
590 let mut list = LinkedList::new();
591 assert_eq!(list.pop_back(), None);
593 list.push_back(1i32);
594 assert_eq!(list.pop_back(), Some(1));
608 let mut list = LinkedList::new();
609 list.push_back(1i32);
610 list.push_back(2i32);
612 let mut iter = list.iter_mut();
630 let mut list = LinkedList::new();
631 assert_eq!(list.back(), None);
633 list.push_back(1i32);
634 assert_eq!(list.back(), Some(&1));
648 let mut list = LinkedList::new();
649 assert_eq!(list.back_mut(), None);
651 list.push_back(1i32);
652 assert_eq!(list.back_mut(), Some(&mut 1));
667 let mut list = LinkedList::new();
668 assert!(list.back_node().is_none());
670 list.push_back(1i32);
671 assert!(list.back_node().is_some());
686 let mut list = LinkedList::new();
687 assert!(list.back_node_mut().is_none());
689 list.push_back(1i32);
690 assert!(list.back_node_mut().is_some());
762 let mut list = LinkedList::new();
763 list.push_back(1i32);
764 list.push_back(2i32);
765 assert_eq!(format!("{list:?}"), "1,2");
779 let mut list = LinkedList::new();
780 list.push_back(1i32);
782 let mut cursor = list.cursor_front();
800 let mut list = LinkedList::new();
801 list.push_back(1i32);
802 list.push_back(2i32);
804 let mut cursor = list.cursor_front();
829 let mut list = LinkedList::new();
830 list.push_back(1i32);
831 list.push_back(2i32);
833 let mut cursor = list.cursor_front();
857 let mut list = LinkedList::new();
858 list.push_back(1i32);
860 let mut cursor = list.cursor_front();
878 let mut list = LinkedList::new();
879 list.push_back(1i32);
881 let mut cursor = list.cursor_front_mut();
899 let mut list = LinkedList::new();
900 list.push_back(1i32);
902 let mut cursor = list.cursor_front_mut();
924 let mut list = LinkedList::new();
925 list.push_back(1i32);
927 let mut cursor = list.cursor_front_mut();
949 let mut list = LinkedList::new();
950 list.push_back(1i32);
952 let mut cursor = list.cursor_front_mut();
970 let mut list = LinkedList::new();
971 list.push_back(1i32);
973 let mut cursor = list.cursor_front_mut();