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.
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
).