Function std::local_data::get_mut

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

Retrieves a mutable value from TLS. The closure provided is yielded Some of a reference to the mutable 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 this or the get methods. This is similar to how it's a runtime error to take two mutable loans on an @mut box.