[][src]Module ambience::thread

Structs

AmbientGuard

Guard value for ambient data that was passed to set(). When AmbientGuard is dropped, the value passed to set() is removed from the ambient data stack and is no longer accessible.

Functions

get

Retrieves thread-local ambient data of type T that was previously set on the same thread. The returned value will always be the most recently set value whose AmbientGuard still exists.

has

Returns true if ambient data of type T is set on the current thread.

set

Sets thread-local ambient data of type T. The value can be accessed on the same thread until the returned AmbientGuard is dropped.

set_rc

Sets thread-local ambient data of type T. Works like set, except the given Rc will be reused internally. Useful in cases where you already have a Rc and don't want to clone its contents.