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.
Prefix searches with a type followed by a colon (e.g.
fn:
) to restrict the search to a given type.
Accepted types are: fn
, mod
,
struct
(or str
), enum
,
trait
, typedef
(or
tdef
).