Struct collections::linked_list::Rawlink [] [src]

struct Rawlink<T> {
    p: Option<Shared<T>>,
}

Fields

p

Methods

impl<T> Rawlink<T>

Rawlink is a type like Option but for holding a raw pointer

fn none() -> Rawlink<T>

Like Option::None for Rawlink

fn some(n: &mut T) -> Rawlink<T>

Like Option::Some for Rawlink

unsafe fn resolve<'a>(&self) -> Option<&'a T>

Convert the Rawlink into an Option value

unsafe because:

  • Dereference of raw pointer.
  • Returns reference of arbitrary lifetime.

unsafe fn resolve_mut<'a>(&mut self) -> Option<&'a mut T>

Convert the Rawlink into an Option value

unsafe because:

  • Dereference of raw pointer.
  • Returns reference of arbitrary lifetime.

fn take(&mut self) -> Rawlink<T>

Return the Rawlink and replace with Rawlink::none()

Trait Implementations

impl<T> Copy for Rawlink<T>

impl<T: Send> Send for Rawlink<T>

impl<T: Sync> Sync for Rawlink<T>

impl<'a, T> From<&'a mut Link<T>> for Rawlink<Node<T>>

fn from(node: &'a mut Link<T>) -> Self

impl<T> Clone for Rawlink<T>

fn clone(&self) -> Rawlink<T>

fn clone_from(&mut self, source: &Self)