Struct JsThreadLocal
pub struct JsThreadLocal<T: 'static> { /* private fields */ }
Wrapper type for imported statics.
This type is used whenever a static is imported from a JS module, for
example this import:
#[wasm_bindgen]
extern "C" {
#[wasm_bindgen(thread_local_v2)]
static console: JsValue;
}
will generate in Rust a value that looks like:
static console: JsThreadLocal<JsValue> = ...;
Implementations
impl<T> JsThreadLocal<T>
fn with<F, R>(&'static self, f: F) -> R where F: FnOnce(&T) -> R,