Struct JsStatic

Deprecated: use with `#[wasm_bindgen(thread_local_v2)]` instead
pub struct JsStatic<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" {
    static console: JsValue;
}

will generate in Rust a value that looks like:

static console: JsStatic<JsValue> = ...;

This type implements Deref to the inner type so it's typically used as if it were &T.

Trait Implementations

impl<T: FromWasmAbi + 'static> Deref for JsStatic<T>

type Target = T;
fn deref(&self) -> &T

Auto Trait Implementations

impl<T> Freeze for JsStatic<T> where &'static LocalKey<T>: Freeze,

impl<T> RefUnwindSafe for JsStatic<T> where &'static LocalKey<T>: RefUnwindSafe,

impl<T> Send for JsStatic<T> where &'static LocalKey<T>: Send,

impl<T> Sync for JsStatic<T> where &'static LocalKey<T>: Sync,

impl<T> Unpin for JsStatic<T> where &'static LocalKey<T>: Unpin,

impl<T> UnsafeUnpin for JsStatic<T> where &'static LocalKey<T>: UnsafeUnpin,

impl<T> UnwindSafe for JsStatic<T> where &'static LocalKey<T>: UnwindSafe,

Blanket Implementations

impl<P, T> Receiver for JsStatic<T> where P: Deref<Target = T> + ?Sized, T: ?Sized,

impl<S, T> Upcast<T> for JsStatic<T> where T: UpcastFrom<S> + ?Sized, S: ?Sized,

impl<T> Any for JsStatic<T> where T: 'static + ?Sized,

impl<T> Borrow<T> for JsStatic<T> where T: ?Sized,

impl<T> BorrowMut<T> for JsStatic<T> where T: ?Sized,

impl<T> From<T> for JsStatic<T>

impl<T, U> Into<U> for JsStatic<T> where U: From<T>,

impl<T, U> TryFrom<U> for JsStatic<T> where U: Into<T>,

impl<T, U> TryInto<U> for JsStatic<T> where U: TryFrom<T>,