pub fn with_state<F, R>(f: F) -> Rwhere F: FnOnce(&RefCell<State>) -> R,
Perform an operation, while having access to the thread-local state.