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§
Auto Trait Implementations§
impl<M, L, A> Freeze for Treap<M, L, A>where
A: Freeze,
impl<M, L, A> RefUnwindSafe for Treap<M, L, A>where
A: RefUnwindSafe,
M: RefUnwindSafe,
L: RefUnwindSafe,
<M as MonoidAct>::Key: RefUnwindSafe,
<M as MonoidAct>::Act: RefUnwindSafe,
<L as LazyMapMonoid>::Key: RefUnwindSafe,
<L as LazyMapMonoid>::Agg: RefUnwindSafe,
<L as LazyMapMonoid>::Act: RefUnwindSafe,
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> Unpin for Treap<M, L, A>
impl<M, L, A> UnsafeUnpin for Treap<M, L, A>where
A: UnsafeUnpin,
impl<M, L, A> UnwindSafe for Treap<M, L, A>where
A: UnwindSafe,
M: UnwindSafe,
L: UnwindSafe,
<M as MonoidAct>::Key: RefUnwindSafe,
<M as MonoidAct>::Act: RefUnwindSafe,
<L as LazyMapMonoid>::Key: RefUnwindSafe,
<L as LazyMapMonoid>::Agg: RefUnwindSafe,
<L as LazyMapMonoid>::Act: RefUnwindSafe,
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