[src]

Function std::local_data::get

pub fn get<T: 'static, U>(key: Key<T>, f: |Option<&T>| -> U) -> U

Retrieves a value from TLS. The closure provided is yielded Some of a reference to the value located in TLS if one exists, or None if the key provided is not present in TLS currently.

It is considered a runtime error to attempt to get a value which is already on loan via the get_mut method provided.