Lines Matching refs:cursor

115     /// Gets the normal cursor of the list and sets the starting point to the list header.
125 /// Gets the variable cursor of the list and sets the starting point to the list header.
135 /// Gets the normal cursor of the list and sets the starting point to the end of the list.
146 /// Gets the variable cursor of the list and sets the start to the end of the list.
280 /// Linked list node, only through a linked list cursor to get the node.
313 let mut cursor = CursorMut {
318 cursor.remove_current()
421 /// A common cursor for a linked list. When the list is empty,
430 /// Gets the position the cursor is pointing to.
431 /// If the cursor points to a virtual position, return None.
440 /// The cursor moves back.
452 /// The cursor moves forward.
465 /// Gets the cursor.
508 /// The cursor moves beck.
520 /// The cursor moves forward.
558 /// Deletes the node to which the cursor is pointing.
782 let mut cursor = list.cursor_front();
783 assert_eq!(cursor.index(), Some(0));
785 cursor.move_next();
786 assert_eq!(cursor.index(), None);
804 let mut cursor = list.cursor_front();
805 assert_eq!(cursor.current(), Some(&1));
807 cursor.move_next();
808 assert_eq!(cursor.current(), Some(&2));
810 cursor.move_next();
811 assert_eq!(cursor.current(), None);
813 cursor.move_next();
814 assert_eq!(cursor.current(), Some(&1));
833 let mut cursor = list.cursor_front();
834 assert_eq!(cursor.current(), Some(&1));
836 cursor.move_prev();
837 assert_eq!(cursor.current(), None);
839 cursor.move_prev();
840 assert_eq!(cursor.current(), Some(&2));
842 cursor.move_prev();
843 assert_eq!(cursor.current(), Some(&1));
860 let mut cursor = list.cursor_front();
861 assert!(cursor.current_node().is_some());
863 cursor.move_next();
864 assert!(cursor.current_node().is_none());
881 let mut cursor = list.cursor_front_mut();
882 assert_eq!(cursor.index(), Some(0));
884 cursor.move_next();
885 assert_eq!(cursor.index(), None);
902 let mut cursor = list.cursor_front_mut();
903 assert!(cursor.current_node().is_some());
905 cursor.move_next();
906 assert!(cursor.current_node().is_none());
908 cursor.move_next();
909 assert!(cursor.current_node().is_some());
927 let mut cursor = list.cursor_front_mut();
928 assert!(cursor.current_node().is_some());
930 cursor.move_prev();
931 assert!(cursor.current_node().is_none());
933 cursor.move_prev();
934 assert!(cursor.current_node().is_some());
952 let mut cursor = list.cursor_front_mut();
953 assert_eq!(cursor.current(), Some(&mut 1));
955 cursor.move_next();
956 assert_eq!(cursor.current(), None);
973 let mut cursor = list.cursor_front_mut();
974 assert_eq!(cursor.remove_current(), Some(1));
975 assert_eq!(cursor.remove_current(), None);