[−][src]Struct lockfreehashmap::atomic::AtomicPtr
Wrapper around [Atomic]. Represents a pointer that can be null at first but never again afterwards.
Methods
impl<T> AtomicPtr<T>
[src]
impl<T> AtomicPtr<T>
pub fn new(value: Option<T>) -> Self
[src]
pub fn new(value: Option<T>) -> Self
pub fn load<'g>(&self, guard: &'g Guard) -> MaybeNull<'g, T>
[src]
pub fn load<'g>(&self, guard: &'g Guard) -> MaybeNull<'g, T>
pub fn relaxed_exists<'g>(&self, guard: &'g Guard) -> bool
[src]
pub fn relaxed_exists<'g>(&self, guard: &'g Guard) -> bool
Check if the pointer is not null (i.e. the value exists), using Ordering::Relaxed
.
pub unsafe fn take<'g>(&self, guard: &'g Guard) -> Option<Box<T>>
[src]
pub unsafe fn take<'g>(&self, guard: &'g Guard) -> Option<Box<T>>
Swaps out the current value, leaving null in its place. Equivalent to [Option::take()].
Unsafe
This is unsafe because there must be no other pointers that can ever access this
AtomicPtr
after this function is called. This is intended to be used for [Drop::drop()].
pub fn compare_and_set<'g>(
&self,
compare: MaybeNull<T>,
set: NotNull<'g, T>,
guard: &'g Guard
) -> Result<NotNull<'g, T>, (MaybeNull<'g, T>, NotNull<'g, T>)>
[src]
pub fn compare_and_set<'g>(
&self,
compare: MaybeNull<T>,
set: NotNull<'g, T>,
guard: &'g Guard
) -> Result<NotNull<'g, T>, (MaybeNull<'g, T>, NotNull<'g, T>)>
pub fn compare_null_and_set<'g>(
&self,
set: NotNull<'g, T>,
guard: &'g Guard
) -> Result<NotNull<'g, T>, (NotNull<'g, T>, NotNull<'g, T>)>
[src]
pub fn compare_null_and_set<'g>(
&self,
set: NotNull<'g, T>,
guard: &'g Guard
) -> Result<NotNull<'g, T>, (NotNull<'g, T>, NotNull<'g, T>)>
pub fn compare_null_and_set_owned<'g>(
&self,
set: NotNullOwned<T>,
guard: &'g Guard
) -> Result<NotNull<'g, T>, (NotNull<'g, T>, NotNullOwned<T>)>
[src]
pub fn compare_null_and_set_owned<'g>(
&self,
set: NotNullOwned<T>,
guard: &'g Guard
) -> Result<NotNull<'g, T>, (NotNull<'g, T>, NotNullOwned<T>)>
pub fn compare_and_set_owned<'g>(
&self,
compare: MaybeNull<T>,
set: NotNullOwned<T>,
guard: &'g Guard
) -> Result<NotNull<'g, T>, (MaybeNull<'g, T>, NotNullOwned<T>)>
[src]
pub fn compare_and_set_owned<'g>(
&self,
compare: MaybeNull<T>,
set: NotNullOwned<T>,
guard: &'g Guard
) -> Result<NotNull<'g, T>, (MaybeNull<'g, T>, NotNullOwned<T>)>
pub fn compare_and_set_owned_weak<'g>(
&self,
compare: MaybeNull<T>,
set: NotNullOwned<T>,
guard: &'g Guard
) -> Result<NotNull<'g, T>, (MaybeNull<'g, T>, NotNullOwned<T>)>
[src]
pub fn compare_and_set_owned_weak<'g>(
&self,
compare: MaybeNull<T>,
set: NotNullOwned<T>,
guard: &'g Guard
) -> Result<NotNull<'g, T>, (MaybeNull<'g, T>, NotNullOwned<T>)>
pub fn tag<'g>(&self, guard: &'g Guard)
[src]
pub fn tag<'g>(&self, guard: &'g Guard)
pub fn is_tagged<'g>(&self, guard: &'g Guard) -> bool
[src]
pub fn is_tagged<'g>(&self, guard: &'g Guard) -> bool
pub unsafe fn try_drop(&mut self, guard: &Guard)
[src]
pub unsafe fn try_drop(&mut self, guard: &Guard)
Trait Implementations
Auto Trait Implementations
impl<T> Send for AtomicPtr<T> where
T: Send + Sync,
impl<T> Send for AtomicPtr<T> where
T: Send + Sync,
impl<T> Sync for AtomicPtr<T> where
T: Send + Sync,
impl<T> Sync for AtomicPtr<T> where
T: Send + Sync,
Blanket Implementations
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
🔬 This is a nightly-only experimental API. (
try_from
)Performs the conversion.
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
🔬 This is a nightly-only experimental API. (
try_from
)Performs the conversion.
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src]
fn get_type_id(&self) -> TypeId
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
Gets the TypeId
of self
. Read more