[src]

Function std::local_data::set

pub fn set<T: 'static>(key: Key<T>, data: T)

Inserts a value into task local storage. If the key is already present in TLS, then the previous value is removed and replaced with the provided data.

It is considered a runtime error to attempt to set a key which is currently on loan via the get or get_mut methods.