[−][src]Struct flize::Atomic
An Atomic
represents a tagged atomic pointer protected by the collection system.
This struct provides methods for manipulating the atomic pointer via
standard atomic operations using Shared
as the corresponding non atomic version.
Implementations
impl<V, T1, T2> Atomic<V, T1, T2> where
T1: Tag,
T2: Tag,
[src]
T1: Tag,
T2: Tag,
pub unsafe fn from_raw(raw: usize) -> Self
[src]
Constructs an Atomic
from a raw tagged pointer represented as an integer.
Safety
Marked unsafe because this is not usually what the user wants.
Atomic::null
should be preferred when possible.
pub fn new(shared: Shared<'_, V, T1, T2>) -> Self
[src]
Constructs a new Atomic
from a tagged pointer.
Safety
The alignment of V
must free up sufficient low bits so that T
fits.
pub fn null() -> Self
[src]
Constructs a new Atomic
with a null value.
pub fn null_vec(len: usize) -> Vec<Self>
[src]
This constructs a Vec<Atomic>
with null values in an optimized manner.
pub fn load<'collector, 'shield, S>(
&self,
ordering: Ordering,
_shield: &'shield S
) -> Shared<'shield, V, T1, T2> where
S: Shield<'collector>,
[src]
&self,
ordering: Ordering,
_shield: &'shield S
) -> Shared<'shield, V, T1, T2> where
S: Shield<'collector>,
Load a the tagged pointer.
pub fn store(&self, data: Shared<'_, V, T1, T2>, ordering: Ordering)
[src]
Store a tagged pointer, replacing the previous value.
pub fn swap<'collector, 'shield, S>(
&self,
new: Shared<'_, V, T1, T2>,
ordering: Ordering,
_shield: &'shield S
) -> Shared<'shield, V, T1, T2> where
S: Shield<'collector>,
[src]
&self,
new: Shared<'_, V, T1, T2>,
ordering: Ordering,
_shield: &'shield S
) -> Shared<'shield, V, T1, T2> where
S: Shield<'collector>,
Swap the stored tagged pointer, returning the old one.
pub fn compare_and_swap<'collector, 'shield, S>(
&self,
current: Shared<'_, V, T1, T2>,
new: Shared<'_, V, T1, T2>,
order: Ordering,
_shield: &'shield S
) -> Shared<'shield, V, T1, T2> where
S: Shield<'collector>,
[src]
&self,
current: Shared<'_, V, T1, T2>,
new: Shared<'_, V, T1, T2>,
order: Ordering,
_shield: &'shield S
) -> Shared<'shield, V, T1, T2> where
S: Shield<'collector>,
Conditionally swap the stored tagged pointer, always returns the previous value.
pub fn compare_exchange<'collector, 'shield, S>(
&self,
current: Shared<'_, V, T1, T2>,
new: Shared<'_, V, T1, T2>,
success: Ordering,
failure: Ordering,
_shield: &'shield S
) -> Result<Shared<'shield, V, T1, T2>, Shared<'shield, V, T1, T2>> where
S: Shield<'collector>,
[src]
&self,
current: Shared<'_, V, T1, T2>,
new: Shared<'_, V, T1, T2>,
success: Ordering,
failure: Ordering,
_shield: &'shield S
) -> Result<Shared<'shield, V, T1, T2>, Shared<'shield, V, T1, T2>> where
S: Shield<'collector>,
Conditionally exchange the stored tagged pointer, always returns the previous value and a result indicating if it was written or not. On success this value is guaranteed to be equal to current.
pub fn compare_exchange_weak<'collector, 'shield, S>(
&self,
current: Shared<'_, V, T1, T2>,
new: Shared<'_, V, T1, T2>,
success: Ordering,
failure: Ordering,
_shield: &'shield S
) -> Result<Shared<'shield, V, T1, T2>, Shared<'shield, V, T1, T2>> where
S: Shield<'collector>,
[src]
&self,
current: Shared<'_, V, T1, T2>,
new: Shared<'_, V, T1, T2>,
success: Ordering,
failure: Ordering,
_shield: &'shield S
) -> Result<Shared<'shield, V, T1, T2>, Shared<'shield, V, T1, T2>> where
S: Shield<'collector>,
Conditionally exchange the stored tagged pointer, always returns the previous value and a result indicating if it was written or not. On success this value is guaranteed to be equal to current.
This variant may spuriously fail on platforms where LL/SC is used. This allows more efficient code generation on those platforms.
Trait Implementations
impl<V, T1, T2> Debug for Atomic<V, T1, T2> where
T1: Tag,
T2: Tag,
[src]
T1: Tag,
T2: Tag,
impl<V, T1, T2> Send for Atomic<V, T1, T2> where
T1: Tag,
T2: Tag,
[src]
T1: Tag,
T2: Tag,
impl<V, T1, T2> Sync for Atomic<V, T1, T2> where
T1: Tag,
T2: Tag,
[src]
T1: Tag,
T2: Tag,
impl<V, T1, T2> Unpin for Atomic<V, T1, T2> where
T1: Tag,
T2: Tag,
[src]
T1: Tag,
T2: Tag,
Auto Trait Implementations
impl<V, T1, T2> RefUnwindSafe for Atomic<V, T1, T2> where
T1: RefUnwindSafe,
T2: RefUnwindSafe,
V: RefUnwindSafe,
T1: RefUnwindSafe,
T2: RefUnwindSafe,
V: RefUnwindSafe,
impl<V, T1, T2> UnwindSafe for Atomic<V, T1, T2> where
T1: UnwindSafe,
T2: UnwindSafe,
V: UnwindSafe,
T1: UnwindSafe,
T2: UnwindSafe,
V: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,