pub fn modify<T: 'static>(key: Key<T>, f: &fn(Option<T>) -> Option<T>)
Modifies a task-local value by temporarily removing it from task-local
storage and then re-inserting if Some
is returned from the closure.
This function will have the same runtime errors as generated from pop
and
set
(the key must not currently be on loan
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
).