[][src]Struct flize::Atomic

#[repr(transparent)]pub struct Atomic<V, T1 = NullTag, T2 = NullTag> where
    T1: Tag,
    T2: Tag
{ /* fields omitted */ }

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]

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]

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]

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]

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]

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]

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]

impl<V, T1, T2> Send for Atomic<V, T1, T2> where
    T1: Tag,
    T2: Tag
[src]

impl<V, T1, T2> Sync for Atomic<V, T1, T2> where
    T1: Tag,
    T2: Tag
[src]

impl<V, T1, T2> Unpin for Atomic<V, T1, T2> where
    T1: Tag,
    T2: Tag
[src]

Auto Trait Implementations

impl<V, T1, T2> RefUnwindSafe for Atomic<V, T1, T2> where
    T1: RefUnwindSafe,
    T2: RefUnwindSafe,
    V: RefUnwindSafe

impl<V, T1, T2> UnwindSafe for Atomic<V, T1, T2> where
    T1: UnwindSafe,
    T2: UnwindSafe,
    V: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

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]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.