pub(crate) fn push_front(&mut self, val: T::Handle) {
        // The value should not be dropped, it is being inserted into the list
        let val = ManuallyDrop::new(val);
        let ptr = T::as_raw(&*val);
        assert_ne!(self.head, Some(ptr));
        unsafe {
            T::pointers(ptr).as_mut().next = self.head;
            T::pointers(ptr).as_mut().prev = None;

            if let Some(head) = self.head {
                T::pointers(head).as_mut().prev = Some(ptr);
            }

            self.head = Some(ptr);

            if self.tail.is_none() {
                self.tail = Some(ptr);
            }
        }
    }
/// Adds an element first in the list.
Adds an element first in the list.
Adds an element first in the list .
pub(crate) fn push_front(&mut self, val: T::Handle) {
        // The value should not be dropped, it is being inserted into the list
        let val = ManuallyDrop::new(val);
        let ptr = T::as_raw(&*val);
        assert_ne!(self.head, Some(ptr));
        unsafe {
            T::pointers(ptr).as_mut().next = self.head;
            T::pointers(ptr).as_mut().prev = None;
            if let Some(head) = self.head {
                T::pointers(head).as_mut().prev = Some(ptr);
            }
            self.head = Some(ptr);
            if self.tail.is_none() {
                self.tail = Some(ptr);
            }
        }
    }
pub ( crate ) fn push_front ( & mut self , val : T :: Handle ) { // The value should not be dropped, it is being inserted into the list let val = ManuallyDrop :: new ( val ) ; let ptr = T :: as_raw ( & * val ) ; assert_ne ! ( self head Some ( ptr ) ) ; unsafe { T :: pointers ( ptr ) . as_mut ( ) . next = self . head ; T :: pointers ( ptr ) . as_mut ( ) . prev = None ; if let Some ( head ) = self . head { T :: pointers ( head ) . as_mut ( ) . prev = Some ( ptr ) ; } self . head = Some ( ptr ) ; if self . tail . is_none ( ) { self . tail = Some ( ptr ) ; } } }
Adds an element first in the list.
Adds an element first in the list .
&mut self
val
T::Handle