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>
impl<Tag, T: Copy + PartialEq> RbTree<Tag, T>
pub const fn new() -> Self
Sourcepub fn insert<S: Get<T> + GetMut<T>>(
&mut self,
id: T,
storage: &mut S,
) -> Result<(), Error>
pub fn insert<S: Get<T> + GetMut<T>>( &mut self, id: T, storage: &mut S, ) -> Result<(), Error>
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.
pub fn remove<S: Get<T> + GetMut<T>>( &mut self, id: T, storage: &mut S, ) -> Result<(), Error>
pub fn min(&self) -> Option<T>
fn insert_fixup<S: Get<T> + GetMut<T>>( &mut self, id: T, storage: &mut S, ) -> Result<(), Error>
fn delete_fixup<S: Get<T> + GetMut<T>>( &mut self, id: Option<T>, parent: Option<T>, storage: &mut S, ) -> Result<(), Error>
fn minimum<S: Get<T>>(&self, id: T, storage: &S) -> Result<T, Error>
fn transplant<S: Get<T> + GetMut<T>>( &mut self, u: T, v: Option<T>, storage: &mut S, ) -> Result<(), Error>
fn rotate_right<S: Get<T> + GetMut<T>>( &mut self, pivot: T, left: T, storage: &mut S, ) -> Result<(), Error>
fn rotate_left<S: Get<T> + GetMut<T>>( &mut self, pivot: T, right: T, storage: &mut S, ) -> Result<(), Error>
Auto Trait Implementations§
impl<Tag, T> Freeze for RbTree<Tag, T>where
T: Freeze,
impl<Tag, T> RefUnwindSafe for RbTree<Tag, T>where
T: RefUnwindSafe,
Tag: RefUnwindSafe,
impl<Tag, T> Send for RbTree<Tag, T>
impl<Tag, T> Sync for RbTree<Tag, T>
impl<Tag, T> Unpin for RbTree<Tag, T>
impl<Tag, T> UnwindSafe for RbTree<Tag, T>where
T: UnwindSafe,
Tag: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more