Struct thread_local_object::ThreadLocal [] [src]

pub struct ThreadLocal<T: 'static> { /* fields omitted */ }

A thread local variable wrapper.

Methods

impl<T: 'static> ThreadLocal<T>
[src]

Creates a new ThreadLocal with no values for any threads.

Panics

Panics if more than usize::max_value() ThreadLocal objects have already been created. This can only ever realistically happen on 32 bit platforms.

Sets this thread's value, returning the previous value if present.

Panics

Panics if called from within the execution of a closure provided to another method on this value.

Removes this thread's value, returning it if it existed.

Panics

Panics if called from within the execution of a closure provided to another method on this value.

Passes a handle to the current thread's value to a closure for in-place manipulation.

The closure is required for the same soundness reasons it is required for the standard library's thread_local! values.

Panics

Panics if called from within the execution of a closure provided to another method on this value.

Passes a mutable reference to the current thread's value to a closure.

The closure is required for the same soundness reasons it is required for the standard library's thread_local! values.

Panics

Panics if called from within the execution of a closure passed to entry or get_mut on this value.

Passes a mutable reference to the current thread's value to a closure.

The closure is required for the same soundness reasons it is required for the standard library's thread_local! values.

Panics

Panics if called from within the execution of a closure provided to another method on this value.

impl<T> ThreadLocal<T> where
    T: 'static + Clone
[src]

Returns a copy of the current thread's value.

Panics

Panics if called from within the execution of a closure passed to entry or get_mut on this value.