Trait intrusive_containers::linked_list::Linkable [] [src]

pub unsafe trait Linkable: Default + Sized {
    type Container;
    fn get_links(&self) -> &Links<Self>;
    fn get_links_mut(&mut self) -> &mut Links<Self>;
    fn offset() -> usize;

    fn get_next<'a>(&'a self) -> &'a Rawlink<Self> where Self: 'a, Self::Container: 'a { ... }
    fn get_next_mut<'a>(&'a mut self) -> &'a mut Rawlink<Self> where Self: 'a, Self::Container: 'a { ... }
    fn get_prev<'a>(&'a self) -> &'a Rawlink<Self> where Self: 'a, Self::Container: 'a { ... }
    fn get_prev_mut<'a>(&'a mut self) -> &'a mut Rawlink<Self> where Self: 'a, Self::Container: 'a { ... }
    unsafe fn container_of(&self) -> &Self::Container { ... }
    unsafe fn container_of_mut(&mut self) -> &mut Self::Container { ... }
    fn check_links(&self) { ... }
}

Link trait allowing a struct to be inserted into a LinkedList

The trait is unsafe because any implementation must impl Drop to call check_links()

Associated Types

type Container

Required Methods

fn offset() -> usize

Provided Methods

fn get_next<'a>(&'a self) -> &'a Rawlink<Self> where Self: 'a, Self::Container: 'a

fn get_next_mut<'a>(&'a mut self) -> &'a mut Rawlink<Self> where Self: 'a, Self::Container: 'a

fn get_prev<'a>(&'a self) -> &'a Rawlink<Self> where Self: 'a, Self::Container: 'a

fn get_prev_mut<'a>(&'a mut self) -> &'a mut Rawlink<Self> where Self: 'a, Self::Container: 'a

unsafe fn container_of(&self) -> &Self::Container

unsafe fn container_of_mut(&mut self) -> &mut Self::Container

Implementors