Lines Matching defs:cursor

27464     /// Provides a cursor at the front element.
27466 /// The cursor is pointing to the "ghost" non-element if the list is empty.
27473 /// Provides a cursor with editing operations at the front element.
27475 /// The cursor is pointing to the "ghost" non-element if the list is empty.
27482 /// Provides a cursor at the back element.
27484 /// The cursor is pointing to the "ghost" non-element if the list is empty.
27491 /// Provides a cursor with editing operations at the back element.
27493 /// The cursor is pointing to the "ghost" non-element if the list is empty.
27866 let mut cursor = self.cursor_front_mut();
27868 cursor.move_next();
27870 cursor.remove_current().unwrap()
27872 let mut cursor = self.cursor_back_mut();
27874 cursor.move_prev();
27876 cursor.remove_current().unwrap()
28048 /// A cursor over a `LinkedList`.
28079 /// A cursor over a `LinkedList` with editing operations.
28104 /// Returns the cursor position index within the `LinkedList`.
28106 /// This returns `None` if the cursor is currently pointing to the
28114 /// Moves the cursor to the next element of the `LinkedList`.
28116 /// If the cursor is pointing to the "ghost" non-element then this will move it to
28122 // We had no current element; the cursor was sitting at the start position
28136 /// Moves the cursor to the previous element of the `LinkedList`.
28138 /// If the cursor is pointing to the "ghost" non-element then this will move it to
28157 /// Returns a reference to the element that the cursor is currently
28160 /// This returns `None` if the cursor is currently pointing to the
28169 /// If the cursor is pointing to the "ghost" non-element then this returns
28185 /// If the cursor is pointing to the "ghost" non-element then this returns
28201 /// Returns the cursor position index within the `LinkedList`.
28203 /// This returns `None` if the cursor is currently pointing to the
28211 /// Moves the cursor to the next element of the `LinkedList`.
28213 /// If the cursor is pointing to the "ghost" non-element then this will move it to
28219 // We had no current element; the cursor was sitting at the start position
28233 /// Moves the cursor to the previous element of the `LinkedList`.
28235 /// If the cursor is pointing to the "ghost" non-element then this will move it to
28254 /// Returns a reference to the element that the cursor is currently
28257 /// This returns `None` if the cursor is currently pointing to the
28266 /// If the cursor is pointing to the "ghost" non-element then this returns
28282 /// If the cursor is pointing to the "ghost" non-element then this returns
28296 /// Returns a read-only cursor pointing to the current element.
28312 /// If the cursor is pointing at the "ghost" non-element then the new element is
28332 /// If the cursor is pointing at the "ghost" non-element then the new element is
28349 /// The element that was removed is returned, and the cursor is
28352 /// If the cursor is currently pointing to the "ghost" non-element then no element
28368 /// The cursor is moved to point to the next element in the current `LinkedList`.
28370 /// If the cursor is currently pointing to the "ghost" non-element then no element
28392 /// If the cursor is pointing at the "ghost" non-element then the new elements are
28415 /// If the cursor is pointing at the "ghost" non-element then the new elements are
28434 /// new list consisting of everything after the cursor, with the original
28437 /// If the cursor is pointing at the "ghost" non-element then the entire contents
28450 /// new list consisting of everything before the cursor, with the original
28453 /// If the cursor is pointing at the "ghost" non-element then the entire contents
29040 let mut cursor = m.cursor_front();
29041 assert_eq!(cursor.current(), Some(&1));
29042 assert_eq!(cursor.peek_next(), Some(&2));
29043 assert_eq!(cursor.peek_prev(), None);
29044 assert_eq!(cursor.index(), Some(0));
29045 cursor.move_prev();
29046 assert_eq!(cursor.current(), None);
29047 assert_eq!(cursor.peek_next(), Some(&1));
29048 assert_eq!(cursor.peek_prev(), Some(&6));
29049 assert_eq!(cursor.index(), None);
29050 cursor.move_next();
29051 cursor.move_next();
29052 assert_eq!(cursor.current(), Some(&2));
29053 assert_eq!(cursor.peek_next(), Some(&3));
29054 assert_eq!(cursor.peek_prev(), Some(&1));
29055 assert_eq!(cursor.index(), Some(1));
29057 let mut cursor = m.cursor_back();
29058 assert_eq!(cursor.current(), Some(&6));
29059 assert_eq!(cursor.peek_next(), None);
29060 assert_eq!(cursor.peek_prev(), Some(&5));
29061 assert_eq!(cursor.index(), Some(5));
29062 cursor.move_next();
29063 assert_eq!(cursor.current(), None);
29064 assert_eq!(cursor.peek_next(), Some(&1));
29065 assert_eq!(cursor.peek_prev(), Some(&6));
29066 assert_eq!(cursor.index(), None);
29067 cursor.move_prev();
29068 cursor.move_prev();
29069 assert_eq!(cursor.current(), Some(&5));
29070 assert_eq!(cursor.peek_next(), Some(&6));
29071 assert_eq!(cursor.peek_prev(), Some(&4));
29072 assert_eq!(cursor.index(), Some(4));
29076 let mut cursor = m.cursor_front_mut();
29077 assert_eq!(cursor.current(), Some(&mut 1));
29078 assert_eq!(cursor.peek_next(), Some(&mut 2));
29079 assert_eq!(cursor.peek_prev(), None);
29080 assert_eq!(cursor.index(), Some(0));
29081 cursor.move_prev();
29082 assert_eq!(cursor.current(), None);
29083 assert_eq!(cursor.peek_next(), Some(&mut 1));
29084 assert_eq!(cursor.peek_prev(), Some(&mut 6));
29085 assert_eq!(cursor.index(), None);
29086 cursor.move_next();
29087 cursor.move_next();
29088 assert_eq!(cursor.current(), Some(&mut 2));
29089 assert_eq!(cursor.peek_next(), Some(&mut 3));
29090 assert_eq!(cursor.peek_prev(), Some(&mut 1));
29091 assert_eq!(cursor.index(), Some(1));
29092 let mut cursor2 = cursor.as_cursor();
29098 assert_eq!(cursor.current(), Some(&mut 2));
29099 assert_eq!(cursor.index(), Some(1));
29103 let mut cursor = m.cursor_back_mut();
29104 assert_eq!(cursor.current(), Some(&mut 6));
29105 assert_eq!(cursor.peek_next(), None);
29106 assert_eq!(cursor.peek_prev(), Some(&mut 5));
29107 assert_eq!(cursor.index(), Some(5));
29108 cursor.move_next();
29109 assert_eq!(cursor.current(), None);
29110 assert_eq!(cursor.peek_next(), Some(&mut 1));
29111 assert_eq!(cursor.peek_prev(), Some(&mut 6));
29112 assert_eq!(cursor.index(), None);
29113 cursor.move_prev();
29114 cursor.move_prev();
29115 assert_eq!(cursor.current(), Some(&mut 5));
29116 assert_eq!(cursor.peek_next(), Some(&mut 6));
29117 assert_eq!(cursor.peek_prev(), Some(&mut 4));
29118 assert_eq!(cursor.index(), Some(4));
29119 let mut cursor2 = cursor.as_cursor();
29125 assert_eq!(cursor.current(), Some(&mut 5));
29126 assert_eq!(cursor.index(), Some(4));
29133 let mut cursor = m.cursor_front_mut();
29134 cursor.insert_before(7);
29135 cursor.insert_after(8);
29138 let mut cursor = m.cursor_front_mut();
29139 cursor.move_prev();
29140 cursor.insert_before(9);
29141 cursor.insert_after(10);
29144 let mut cursor = m.cursor_front_mut();
29145 cursor.move_prev();
29146 assert_eq!(cursor.remove_current(), None);
29147 cursor.move_next();
29148 cursor.move_next();
29149 assert_eq!(cursor.remove_current(), Some(7));
29150 cursor.move_prev();
29151 cursor.move_prev();
29152 cursor.move_prev();
29153 assert_eq!(cursor.remove_current(), Some(9));
29154 cursor.move_next();
29155 assert_eq!(cursor.remove_current(), Some(10));
29158 let mut cursor = m.cursor_front_mut();
29163 cursor.splice_after(p);
29164 cursor.splice_before(q);
29170 let mut cursor = m.cursor_front_mut();
29171 cursor.move_prev();
29172 let tmp = cursor.split_before();
29175 let mut cursor = m.cursor_front_mut();
29176 cursor.move_next();
29177 cursor.move_next();
29178 cursor.move_next();
29179 cursor.move_next();
29180 cursor.move_next();
29181 cursor.move_next();
29182 let tmp = cursor.split_after();