pub struct Radix<T>{ /* private fields */ }Expand description
A simple lock-free radix tree.
Implementations§
Source§impl<T> Radix<T>
impl<T> Radix<T>
Sourcepub fn insert(&self, pid: usize, item: T) -> Result<(), ()>
pub fn insert(&self, pid: usize, item: T) -> Result<(), ()>
Try to create a new item in the tree.
Sourcepub fn swap<'s>(
&self,
pid: usize,
new: Ptr<'s, T>,
scope: &'s Scope,
) -> Ptr<'s, T>
pub fn swap<'s>( &self, pid: usize, new: Ptr<'s, T>, scope: &'s Scope, ) -> Ptr<'s, T>
Atomically swap the previous value in a tree with a new one.
Sourcepub fn cas<'s>(
&self,
pid: usize,
old: Ptr<'s, T>,
new: Ptr<'s, T>,
scope: &'s Scope,
) -> Result<Ptr<'s, T>, Ptr<'s, T>>
pub fn cas<'s>( &self, pid: usize, old: Ptr<'s, T>, new: Ptr<'s, T>, scope: &'s Scope, ) -> Result<Ptr<'s, T>, Ptr<'s, T>>
Compare and swap an old value to a new one.
Trait Implementations§
Auto Trait Implementations§
impl<T> !Freeze for Radix<T>
impl<T> RefUnwindSafe for Radix<T>where
T: RefUnwindSafe,
impl<T> Send for Radix<T>
impl<T> Sync for Radix<T>
impl<T> Unpin for Radix<T>
impl<T> UnwindSafe for Radix<T>where
T: 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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more