pub struct Treap<M, L, A = BoxAllocator<BstNode<TreapData<M, L>, WithParent<TreapData<M, L>>>>>where
M: MonoidAct<Key: Ord>,
L: LazyMapMonoid,
A: Allocator<BstNode<TreapData<M, L>, WithParent<TreapData<M, L>>>>,{
root: Option<BstRoot<TreapSpec<M, L>>>,
node_id_manager: BstNodeIdManager<TreapSpec<M, L>>,
rng: Xorshift,
allocator: ManuallyDrop<A>,
_marker: PhantomData<(M, L)>,
}Fields§
§root: Option<BstRoot<TreapSpec<M, L>>>§node_id_manager: BstNodeIdManager<TreapSpec<M, L>>§rng: Xorshift§allocator: ManuallyDrop<A>§_marker: PhantomData<(M, L)>Implementations§
Source§impl<M, L, A> Treap<M, L, A>where
M: MonoidAct<Key: Ord>,
L: LazyMapMonoid,
A: Allocator<BstNode<TreapData<M, L>, WithParent<TreapData<M, L>>>>,
impl<M, L, A> Treap<M, L, A>where
M: MonoidAct<Key: Ord>,
L: LazyMapMonoid,
A: Allocator<BstNode<TreapData<M, L>, WithParent<TreapData<M, L>>>>,
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn clear(&mut self)
pub fn get( &mut self, node_id: BstNodeId<TreapSpec<M, L>>, ) -> Option<(&M::Key, &L::Key)>
pub fn change( &mut self, node_id: BstNodeId<TreapSpec<M, L>>, f: impl FnOnce(&mut L::Key), ) -> bool
pub fn change_key_value( &mut self, node_id: BstNodeId<TreapSpec<M, L>>, f: impl FnOnce(&mut M::Key, &mut L::Key), ) -> bool
pub fn insert( &mut self, key: M::Key, value: L::Key, ) -> BstNodeId<TreapSpec<M, L>>
pub fn remove( &mut self, node_id: BstNodeId<TreapSpec<M, L>>, ) -> Option<(M::Key, L::Key)>
pub fn range_by_key<Q, R>(&mut self, range: R) -> TreapSplit3<'_, M, L>
pub fn find_by_key<Q>(&mut self, key: &Q) -> Option<BstNodeId<TreapSpec<M, L>>>
pub fn find_by_acc_cond<F>( &mut self, f: F, ) -> Option<BstNodeId<TreapSpec<M, L>>>
pub fn find_by_racc_cond<F>( &mut self, f: F, ) -> Option<BstNodeId<TreapSpec<M, L>>>
Trait Implementations§
Source§impl<M, L, A> Default for Treap<M, L, A>where
M: MonoidAct<Key: Ord>,
L: LazyMapMonoid,
A: Allocator<BstNode<TreapData<M, L>, WithParent<TreapData<M, L>>>> + Default,
impl<M, L, A> Default for Treap<M, L, A>where
M: MonoidAct<Key: Ord>,
L: LazyMapMonoid,
A: Allocator<BstNode<TreapData<M, L>, WithParent<TreapData<M, L>>>> + Default,
Auto Trait Implementations§
impl<M, L, A = BoxAllocator<BstNode<TreapData<M, L>, WithParent<TreapData<M, L>>>>> !Send for Treap<M, L, A>
impl<M, L, A = BoxAllocator<BstNode<TreapData<M, L>, WithParent<TreapData<M, L>>>>> !Sync for Treap<M, L, A>
impl<M, L, A> Freeze for Treap<M, L, A>where
Option<BstNodeRef<Owned, TreapSpec<M, L>>>: Freeze,
BstNodeIdManager<TreapSpec<M, L>>: Freeze,
ManuallyDrop<A>: Freeze,
PhantomData<(M, L)>: Freeze,
impl<M, L, A> RefUnwindSafe for Treap<M, L, A>where
Option<BstNodeRef<Owned, TreapSpec<M, L>>>: RefUnwindSafe,
BstNodeIdManager<TreapSpec<M, L>>: RefUnwindSafe,
ManuallyDrop<A>: RefUnwindSafe,
PhantomData<(M, L)>: RefUnwindSafe,
impl<M, L, A> Unpin for Treap<M, L, A>where
Option<BstNodeRef<Owned, TreapSpec<M, L>>>: Unpin,
BstNodeIdManager<TreapSpec<M, L>>: Unpin,
ManuallyDrop<A>: Unpin,
PhantomData<(M, L)>: Unpin,
impl<M, L, A> UnsafeUnpin for Treap<M, L, A>where
Option<BstNodeRef<Owned, TreapSpec<M, L>>>: UnsafeUnpin,
BstNodeIdManager<TreapSpec<M, L>>: UnsafeUnpin,
ManuallyDrop<A>: UnsafeUnpin,
PhantomData<(M, L)>: UnsafeUnpin,
impl<M, L, A> UnwindSafe for Treap<M, L, A>where
Option<BstNodeRef<Owned, TreapSpec<M, L>>>: UnwindSafe,
BstNodeIdManager<TreapSpec<M, L>>: UnwindSafe,
ManuallyDrop<A>: UnwindSafe,
PhantomData<(M, L)>: 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