Lines Matching defs:current

3815 // The current implementation of SliceIndex fails to handle methods
14674 // checks to get our current layout.
14798 /// Panics if the given amount is *larger* than the current capacity.
17211 /// If the current capacity is less than the lower limit, this is a no-op.
17280 /// If `new_len` is greater than the string's current length, this has no
22208 /// The current algorithm is an adaptive, iterative merge sort inspired by
22259 /// The current algorithm is an adaptive, iterative merge sort inspired by
22302 /// The current algorithm is an adaptive, iterative merge sort inspired by
22341 /// The current algorithm is based on [pattern-defeating quicksort][pdqsort] by Orson Peters,
23148 /// the current thread.
23160 /// /// A waker that wakes up the current thread when called.
23169 /// /// Run a future to completion on the current thread.
23175 /// let t = thread::current();
26110 //! well as [`isize`]). The current mapping of types to traits is:
27158 /// Unlinks the specified node from the current list.
27160 /// Warning: this will not check that the provided node belongs to the current list.
27470 Cursor { index: 0, current: self.head, list: self }
27479 CursorMut { index: 0, current: self.head, list: self }
27488 Cursor { index: self.len.checked_sub(1).unwrap_or(0), current: self.tail, list: self }
27497 CursorMut { index: self.len.checked_sub(1).unwrap_or(0), current: self.tail, list: self }
28060 current: Option<NonNull<Node<T>>>,
28067 let Cursor { index, current, list } = *self;
28068 Cursor { index, current, list }
28092 current: Option<NonNull<Node<T>>>,
28110 let _ = self.current?;
28121 match self.current.take() {
28122 // We had no current element; the cursor was sitting at the start position
28125 self.current = self.list.head;
28129 Some(current) => unsafe {
28130 self.current = current.as_ref().next;
28143 match self.current.take() {
28144 // No current. We're at the start of the list. Yield None and jump to the end.
28146 self.current = self.list.tail;
28150 Some(current) => unsafe {
28151 self.current = current.as_ref().prev;
28163 pub fn current(&self) -> Option<&'a T> {
28164 unsafe { self.current.map(|current| &(*current.as_ptr()).element) }
28175 let next = match self.current {
28177 Some(current) => current.as_ref().next,
28191 let prev = match self.current {
28193 Some(current) => current.as_ref().prev,
28207 let _ = self.current?;
28218 match self.current.take() {
28219 // We had no current element; the cursor was sitting at the start position
28222 self.current = self.list.head;
28226 Some(current) => unsafe {
28227 self.current = current.as_ref().next;
28240 match self.current.take() {
28241 // No current. We're at the start of the list. Yield None and jump to the end.
28243 self.current = self.list.tail;
28247 Some(current) => unsafe {
28248 self.current = current.as_ref().prev;
28260 pub fn current(&mut self) -> Option<&mut T> {
28261 unsafe { self.current.map(|current| &mut (*current.as_ptr()).element) }
28272 let next = match self.current {
28274 Some(current) => current.as_ref().next,
28288 let prev = match self.current {
28290 Some(current) => current.as_ref().prev,
28296 /// Returns a read-only cursor pointing to the current element.
28303 Cursor { list: self.list, current: self.current, index: self.index }
28310 /// Inserts a new element into the `LinkedList` after the current one.
28318 let node_next = match self.current {
28322 self.list.splice_nodes(self.current, node_next, spliced_node, spliced_node, 1);
28323 if self.current.is_none() {
28330 /// Inserts a new element into the `LinkedList` before the current one.
28338 let node_prev = match self.current {
28342 self.list.splice_nodes(node_prev, self.current, spliced_node, spliced_node, 1);
28347 /// Removes the current element from the `LinkedList`.
28356 let unlinked_node = self.current?;
28358 self.current = unlinked_node.as_ref().next;
28365 /// Removes the current element from the `LinkedList` without deallocating the list node.
28368 /// The cursor is moved to point to the next element in the current `LinkedList`.
28374 let mut unlinked_node = self.current?;
28376 self.current = unlinked_node.as_ref().next;
28390 /// Inserts the elements from the given `LinkedList` after the current one.
28401 let node_next = match self.current {
28405 self.list.splice_nodes(self.current, node_next, splice_head, splice_tail, splice_len);
28406 if self.current.is_none() {
28413 /// Inserts the elements from the given `LinkedList` before the current one.
28424 let node_prev = match self.current {
28428 self.list.splice_nodes(node_prev, self.current, splice_head, splice_tail, splice_len);
28433 /// Splits the list into two after the current element. This will return a
28446 unsafe { self.list.split_off_after_node(self.current, split_off_idx) }
28449 /// Splits the list into two before the current element. This will return a
28459 unsafe { self.list.split_off_before_node(self.current, split_off_idx) }
29041 assert_eq!(cursor.current(), Some(&1));
29046 assert_eq!(cursor.current(), None);
29052 assert_eq!(cursor.current(), Some(&2));
29058 assert_eq!(cursor.current(), Some(&6));
29063 assert_eq!(cursor.current(), None);
29069 assert_eq!(cursor.current(), Some(&5));
29077 assert_eq!(cursor.current(), Some(&mut 1));
29082 assert_eq!(cursor.current(), None);
29088 assert_eq!(cursor.current(), Some(&mut 2));
29093 assert_eq!(cursor2.current(), Some(&2));
29096 assert_eq!(cursor2.current(), Some(&3));
29098 assert_eq!(cursor.current(), Some(&mut 2));
29104 assert_eq!(cursor.current(), Some(&mut 6));
29109 assert_eq!(cursor.current(), None);
29115 assert_eq!(cursor.current(), Some(&mut 5));
29120 assert_eq!(cursor2.current(), Some(&5));
29123 assert_eq!(cursor2.current(), Some(&4));
29125 assert_eq!(cursor.current(), Some(&mut 5));
29225 // Try to push key-value pair into the current leaf node.
35630 // ascending order, in the current opinion of the `Ord` implementation.
36752 // so this is just the current implementation:
38227 /// Finds the parent of the current node. Returns `Ok(handle)` if the current
38229 /// that points to the current node. Returns `Err(self)` if the current node has
38309 /// deallocates the current node in the process. This is unsafe because the
38310 /// current node will still be accessible despite being deallocated.
41121 /// If the current capacity is less than the lower limit, this is a no-op.
41203 /// If `len` is greater than the `VecDeque`'s current length, this has no
44324 //! // Start at `start` and use `dist` to track the current shortest distance
44329 //! // dist[node] = current shortest distance from `start` to `node`
45230 /// If the current capacity is less than the lower limit, this is a no-op.
47142 /// when full, nor when [`reserve`] is called. The current strategy is basic
47727 /// If the current capacity is less than the lower limit, this is a no-op.
47787 /// If `len` is greater than the vector's current length, this has no
47806 /// No truncation occurs when `len` is greater than the vector's current
48274 // SAFETY: `deleted_cnt` > 0, so the hole slot must not overlap with current element.