[src]

Function std::local_data::modify

pub fn modify<T: 'static>(key: Key<T>, f: |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