pub struct AtomSetOnce<P> where
    P: IntoRawPtr + FromRawPtr
{ /* private fields */ }
Expand description

This is a restricted version of the Atom. It allows for only set_if_none to be called.

swap and take can be used only with a mutable reference. Meaning that AtomSetOnce is not usable as a

Implementations

Create an empty AtomSetOnce

Create a new AtomSetOnce from Pointer P

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

Convert an AtomSetOnce into an Atom

Allow access to the atom if exclusive access is granted

Check to see if an atom is None

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

If the Atom is set, get the value

If the Atom is set, get the value

Duplicate the inner pointer if it is set

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.