Lines Matching refs:current
120 current: self.head,
130 current: self.head,
141 current: self.tail,
152 current: self.tail,
197 // Sets node.parent to the current linked_list in order to delete node.
315 current: self as *const Node<T>,
425 current: *const Node<T>,
434 if self.current.is_null() {
443 if self.current.is_null() {
444 self.current = self.list.head;
447 self.current = unsafe { (*self.current).next };
456 if self.current.is_null() {
457 self.current = self.list.tail;
460 self.current = unsafe { (*self.current).prev };
467 pub(crate) fn current(&self) -> Option<&'a T> {
468 if self.current.is_null() {
471 unsafe { Some(&(*self.current).element) }
475 /// Gets a reference to the current node.
478 if self.current.is_null() {
481 unsafe { Some(&*(self.current)) }
488 self.current
494 current: *const Node<T>,
502 if self.current.is_null() {
511 if self.current.is_null() {
512 self.current = self.list.head;
515 self.current = unsafe { (*self.current).next };
524 if self.current.is_null() {
525 self.current = self.list.tail;
528 self.current = unsafe { (*self.current).prev };
533 /// Gets a mutable reference to the current element.
536 pub(crate) fn current(&mut self) -> Option<&mut T> {
537 if self.current.is_null() {
540 unsafe { Some(&mut (*(self.current as *mut Node<T>)).element) }
544 /// Gets a mutable reference to the current node.
547 if self.current.is_null() {
551 let node = &mut *(self.current as *mut Node<T>);
561 if self.current.is_null() {
565 let unlinked_node = self.current;
567 self.current = (*unlinked_node).next;
805 assert_eq!(cursor.current(), Some(&1));
808 assert_eq!(cursor.current(), Some(&2));
811 assert_eq!(cursor.current(), None);
814 assert_eq!(cursor.current(), Some(&1));
834 assert_eq!(cursor.current(), Some(&1));
837 assert_eq!(cursor.current(), None);
840 assert_eq!(cursor.current(), Some(&2));
843 assert_eq!(cursor.current(), Some(&1));
937 /// UT test for `CursorMut::current`.
944 /// 2. Calls `CursorMut::current`.
953 assert_eq!(cursor.current(), Some(&mut 1));
956 assert_eq!(cursor.current(), None);
959 /// UT test for `CursorMut::current`.
966 /// 2. Calls `CursorMut::current`.