Lines Matching defs:node
54 let mut node = Box::new(Node::new(value));
57 node.prev = self.tail;
59 let node = Box::leak(node) as *const Node<T>;
62 self.head = node;
64 (*(self.tail as *mut Node<T>)).next = node;
67 self.tail = node;
78 let node = Box::from_raw(self.tail as *mut Node<T>);
79 self.tail = node.prev;
88 Some(node.into_element())
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.
197 // Sets node.parent to the current linked_list in order to delete node.
198 let node = &mut *(self.tail as *mut Node<T>);
199 node.parent = self as *const LinkedList<T>;
200 Some(node)
205 /// Removes a node from the linked list.
206 pub(crate) unsafe fn unlink_node(&mut self, node: *const Node<T>) {
207 let node = &mut (*(node as *mut Node<T>));
209 if node.prev.is_null() {
210 self.head = node.next;
212 (*(node.prev as *mut Node<T>)).next = node.next;
215 if node.next.is_null() {
216 self.tail = node.prev;
218 (*(node.next as *mut Node<T>)).prev = node.prev;
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.
338 let node = unsafe { &*(self.head as *mut Node<T>) };
340 self.head = node.next;
341 Some(&node.element)
363 let node = unsafe { &*(self.tail as *mut Node<T>) };
365 self.tail = node.prev;
366 Some(&node.element)
387 let node = unsafe { &mut *(self.head as *mut Node<T>) };
389 self.head = node.next;
390 Some(&mut node.element)
413 let node = unsafe { &mut *(self.tail as *mut Node<T>) };
415 self.tail = node.prev;
416 Some(&mut node.element)
422 /// it points to a virtual location (pointing to a node that does not actually exist).
475 /// Gets a reference to the current node.
544 /// Gets a mutable reference to the current node.
551 let node = &mut *(self.current as *mut Node<T>);
552 node.parent = self.list as *mut LinkedList<T>;
553 Some(node)
558 /// Deletes the node to which the cursor is pointing.