Struct atom::Atom [] [src]

pub struct Atom<P> where
    P: IntoRawPtr + FromRawPtr
{ /* fields omitted */ }

An Atom wraps an AtomicPtr, it allows for safe mutation of an atomic into common Rust Types.

Methods

impl<P> Atom<P> where
    P: IntoRawPtr + FromRawPtr
[src]

Create a empty Atom

Create a new Atomic from Pointer P

Swap a new value into the Atom, This will try multiple times until it succeeds. The old value will be returned.

Take the value of the Atom replacing it with null pointer Returning the contents. If the contents was a null pointer the result will be None.

This will do a CAS setting the value only if it is NULL this will return None if the value was written, otherwise a Some(v) will be returned, where the value was the same value that you passed into this function

Take the current content, write it into P then do a CAS to extent this Atom with the previous contents. This can be used to create a LIFO

Returns true if this set this migrated the Atom from null.

Check to see if an atom is None

This only means that the contents was None when it was measured

Trait Implementations

impl<P> Debug for Atom<P> where
    P: IntoRawPtr + FromRawPtr
[src]

Formats the value using the given formatter.

impl<P> Drop for Atom<P> where
    P: IntoRawPtr + FromRawPtr
[src]

A method called when the value goes out of scope. Read more

impl<P> Send for Atom<P> where
    P: IntoRawPtr + FromRawPtr
[src]

impl<P> Sync for Atom<P> where
    P: IntoRawPtr + FromRawPtr
[src]