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]

[src]

Create a empty Atom

[src]

Create a new Atomic from Pointer P

[src]

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

[src]

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.

[src]

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

[src]

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.

[src]

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]

[src]

Formats the value using the given formatter. Read more

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

[src]

Executes the destructor for this type. Read more

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

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