/// Prepends an element to the back of the list
Prepends an element to the back of the list
Prepends an element to the back of the list
fn push_back(&mut self, node: Arc<Node<T, W>>) -> *const Node<T, W> {
        let ptr = arc2ptr(node);
        unsafe {
            // Point to the current last node in the list
            *(*ptr).prev_all.get() = self.tail;
            *(*ptr).next_all.get() = ptr::null_mut();
            if !self.tail.is_null() {
                *(*self.tail).next_all.get() = ptr;
                self.tail = ptr;
            } else {
                // This is the first node
                self.tail = ptr;
                self.head = ptr;
            }
        }
        self.len += 1;
        return ptr
    }
fn push_back ( & mut self , node : Arc < Node < T , W > > ) -> * const Node < T , W > { let ptr = arc2ptr ( node ) ; unsafe { // Point to the current last node in the list * ( * ptr ) . prev_all . get ( ) = self . tail ; * ( * ptr ) . next_all . get ( ) = ptr :: null_mut ( ) ; if ! self . tail . is_null ( ) { * ( * self . tail ) . next_all . get ( ) = ptr ; self . tail = ptr ; } else { // This is the first node self . tail = ptr ; self . head = ptr ; } } self . len += 1 ; return ptr }
Prepends an element to the back of the list
Prepends an element to the back of the list
&mut self
node
Arc<Node<T, W>>