RbTree

Struct RbTree 

Source
pub struct RbTree<Tag, T: Copy> {
    root: Option<T>,
    min: Option<T>,
    _tag: PhantomData<Tag>,
}

Fields§

§root: Option<T>§min: Option<T>§_tag: PhantomData<Tag>

Implementations§

Source§

impl<Tag, T: Copy + PartialEq> RbTree<Tag, T>

Source

pub const fn new() -> Self

Source

pub fn insert<S: Get<T> + GetMut<T>>( &mut self, id: T, storage: &mut S, ) -> Result<(), Error>
where <S as Get<T>>::Output: Linkable<Tag, T> + Compare<Tag, T>,

Inserts id into the tree. If id already exists in the tree, it is first removed and then re-inserted. Errors if id does not exist in storage.

Source

pub fn remove<S: Get<T> + GetMut<T>>( &mut self, id: T, storage: &mut S, ) -> Result<(), Error>
where <S as Get<T>>::Output: Linkable<Tag, T> + Compare<Tag, T>,

Source

pub fn min(&self) -> Option<T>

Source

fn insert_fixup<S: Get<T> + GetMut<T>>( &mut self, id: T, storage: &mut S, ) -> Result<(), Error>
where <S as Get<T>>::Output: Linkable<Tag, T> + Compare<Tag, T>,

Source

fn delete_fixup<S: Get<T> + GetMut<T>>( &mut self, id: Option<T>, parent: Option<T>, storage: &mut S, ) -> Result<(), Error>
where <S as Get<T>>::Output: Linkable<Tag, T> + Compare<Tag, T>,

Source

fn minimum<S: Get<T>>(&self, id: T, storage: &S) -> Result<T, Error>
where <S as Get<T>>::Output: Linkable<Tag, T> + Compare<Tag, T>,

Source

fn transplant<S: Get<T> + GetMut<T>>( &mut self, u: T, v: Option<T>, storage: &mut S, ) -> Result<(), Error>
where <S as Get<T>>::Output: Linkable<Tag, T> + Compare<Tag, T>,

Source

fn rotate_right<S: Get<T> + GetMut<T>>( &mut self, pivot: T, left: T, storage: &mut S, ) -> Result<(), Error>
where <S as Get<T>>::Output: Linkable<Tag, T> + Compare<Tag, T>,

Source

fn rotate_left<S: Get<T> + GetMut<T>>( &mut self, pivot: T, right: T, storage: &mut S, ) -> Result<(), Error>
where <S as Get<T>>::Output: Linkable<Tag, T> + Compare<Tag, T>,

Auto Trait Implementations§

§

impl<Tag, T> Freeze for RbTree<Tag, T>
where T: Freeze,

§

impl<Tag, T> RefUnwindSafe for RbTree<Tag, T>

§

impl<Tag, T> Send for RbTree<Tag, T>
where T: Send, Tag: Send,

§

impl<Tag, T> Sync for RbTree<Tag, T>
where T: Sync, Tag: Sync,

§

impl<Tag, T> Unpin for RbTree<Tag, T>
where T: Unpin, Tag: Unpin,

§

impl<Tag, T> UnwindSafe for RbTree<Tag, T>
where T: UnwindSafe, Tag: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> ThreadArgument for T
where T: Send + 'static,