Enum std::thread::LocalKeyState [] [src]

pub enum LocalKeyState {
    Uninitialized,
    Valid,
    Destroyed,
}
Unstable

: state querying was recently added

Indicator of the state of a thread local storage key.

Variants

Uninitialized
Unstable

: state querying was recently added

All keys are in this state whenever a thread starts. Keys will transition to the Valid`Validstate once the first call to` state once the first call to with`with` happens and the initialization expression succeeds.

Keys in the Uninitialized`Uninitializedstate will yield a reference to the closure passed to` state will yield a reference to the closure passed to with`with` so long as the initialization routine does not panic.

Valid
Unstable

: state querying was recently added

Once a key has been accessed successfully, it will enter the Valid`Validstate. Keys in the` state. Keys in the Valid`Validstate will remain so until the thread exits, at which point the destructor will be run and the key will enter the` state will remain so until the thread exits, at which point the destructor will be run and the key will enter the Destroyed`Destroyed` state.

Keys in the Valid`Validstate will be guaranteed to yield a reference to the closure passed to` state will be guaranteed to yield a reference to the closure passed to with`with`.

Destroyed
Unstable

: state querying was recently added

When a thread exits, the destructors for keys will be run (if necessary). While a destructor is running, and possibly after a destructor has run, a key is in the Destroyed`Destroyed` state.

Keys in the Destroyed`Destroyedstates will trigger a panic when accessed via` states will trigger a panic when accessed via with`with`.

Trait Implementations

Derived Implementations

impl Clone for LocalKeyState

fn clone(&self) -> LocalKeyState

fn clone_from(&mut self, source: &Self)

impl Copy for LocalKeyState

impl PartialEq for LocalKeyState

fn eq(&self, __arg_0: &LocalKeyState) -> bool

fn ne(&self, __arg_0: &LocalKeyState) -> bool

impl Eq for LocalKeyState