Trait intrusive_collections::rbtree::RBTreeOps

source ·
pub unsafe trait RBTreeOps: LinkOps {
    // Required methods
    unsafe fn left(&self, ptr: Self::LinkPtr) -> Option<Self::LinkPtr>;
    unsafe fn right(&self, ptr: Self::LinkPtr) -> Option<Self::LinkPtr>;
    unsafe fn parent(&self, ptr: Self::LinkPtr) -> Option<Self::LinkPtr>;
    unsafe fn color(&self, ptr: Self::LinkPtr) -> Color;
    unsafe fn set_left(
        &mut self,
        ptr: Self::LinkPtr,
        left: Option<Self::LinkPtr>,
    );
    unsafe fn set_right(
        &mut self,
        ptr: Self::LinkPtr,
        right: Option<Self::LinkPtr>,
    );
    unsafe fn set_parent(
        &mut self,
        ptr: Self::LinkPtr,
        parent: Option<Self::LinkPtr>,
    );
    unsafe fn set_color(&mut self, ptr: Self::LinkPtr, color: Color);
}
Expand description

Link operations for RBTree.

Required Methods§

source

unsafe fn left(&self, ptr: Self::LinkPtr) -> Option<Self::LinkPtr>

Returns the left child of ptr.

§Safety

An implementation of left must not panic.

source

unsafe fn right(&self, ptr: Self::LinkPtr) -> Option<Self::LinkPtr>

Returns the right child of ptr.

§Safety

An implementation of right must not panic.

source

unsafe fn parent(&self, ptr: Self::LinkPtr) -> Option<Self::LinkPtr>

Returns the parent of ptr.

§Safety

An implementation of parent must not panic.

source

unsafe fn color(&self, ptr: Self::LinkPtr) -> Color

Returns the color of ptr.

§Safety

An implementation of color must not panic.

source

unsafe fn set_left(&mut self, ptr: Self::LinkPtr, left: Option<Self::LinkPtr>)

Sets the left child of ptr.

§Safety

An implementation of set_left must not panic.

source

unsafe fn set_right(&mut self, ptr: Self::LinkPtr, right: Option<Self::LinkPtr>)

Sets the right child of ptr.

§Safety

An implementation of set_right must not panic.

source

unsafe fn set_parent( &mut self, ptr: Self::LinkPtr, parent: Option<Self::LinkPtr>, )

Sets the parent of ptr.

§Safety

An implementation of set_parent must not panic.

source

unsafe fn set_color(&mut self, ptr: Self::LinkPtr, color: Color)

Sets the color of ptr.

§Safety

An implementation of set_color must not panic.

Implementors§