Struct WeakMap
#[repr(transparent)]
pub struct WeakMap<K = Object, V = JsValue> { /* private fields */ }
Implementations
impl WeakMap
fn new() -> WeakMapThe
WeakMapobject is a collection of key/value pairs in which the keys are weakly referenced. The keys must be objects and the values can be arbitrary values.Note: Consider using
WeakMap::new_typedto support typing.
impl<K, V> WeakMap<K, V>
fn get_checked(&self, key: &K) -> Option<V> where K: ErasableGenericBorrow<JsValue>, Option<V>: ErasableGenericOwn<Option<JsValue>>,The
get()method returns a specified by key element from aWeakMapobject. ReturnsNoneif the key is not found.
impl<K, V> WeakMap<K, V>
impl<K, V> WeakMap<K, V>
fn get(&self, key: &K) -> V where K: ErasableGenericBorrow<JsValue>, V: ErasableGenericOwn<JsValue>,The
get()method returns a specified by key element from aWeakMapobject. Returnsundefinedif the key is not found.Note: Consider using
WeakMap::get_checkedto get anOption<V>instead.
impl<K, V> WeakMap<K, V>
fn has(&self, key: &K) -> bool where K: ErasableGenericBorrow<JsValue>,The
has()method returns a boolean indicating whether an element with the specified key exists in theWeakMapobject or not.
impl<K, V> WeakMap<K, V>
fn delete(&self, key: &K) -> bool where K: ErasableGenericBorrow<JsValue>,The
delete()method removes the specified element from aWeakMapobject.
impl<K, V> WeakMap<K, V>
where
K: JsGeneric,
V: JsGeneric,
fn new_typed() -> WeakMap<K, V> where WeakMap<K, V>: ErasableGenericOwn<WeakMap<Object, Object>>,The
WeakMapobject is a collection of key/value pairs in which the keys are weakly referenced. The keys must be objects and the values can be arbitrary values.
Trait Implementations
impl Default for WeakMap
fn default() -> Self
impl From<JsValue> for WeakMap
fn from(obj: JsValue) -> Self
impl<K, V> AsRef<JsValue> for WeakMap<K, V>
fn as_ref(&self) -> &JsValue
impl<K, V> AsRef<Object> for WeakMap<K, V>
fn as_ref(&self) -> &Object
impl<K, V> AsRef<WeakMap<K, V>> for WeakMap<K, V>
fn as_ref(&self) -> &WeakMap<K, V>
impl<K, V> Deref for WeakMap<K, V>
type Target = Object;fn deref(&self) -> &Object
impl<K, V> ErasableGeneric for WeakMap<K, V>
type Repr = JsValue;
impl<K, V> FromWasmAbi for WeakMap<K, V>
type Abi = <JsValue as FromWasmAbi>::Abi;unsafe fn from_abi(js: Self::Abi) -> Self
impl<K, V> IntoJsGeneric for WeakMap<K, V>
where
WeakMap<K, V>: JsGeneric,
type JsCanon = WeakMap<K, V>;fn to_js(self) -> WeakMap<K, V>
impl<K, V> IntoWasmAbi for WeakMap<K, V>
type Abi = <JsValue as IntoWasmAbi>::Abi;fn into_abi(self) -> Self::Abi
impl<K, V> JsCast for WeakMap<K, V>
fn instanceof(val: &JsValue) -> boolfn unchecked_from_js(val: JsValue) -> Selffn unchecked_from_js_ref(val: &JsValue) -> &Self
impl<K, V> LongRefFromWasmAbi for WeakMap<K, V>
type Abi = <JsValue as LongRefFromWasmAbi>::Abi;type Anchor = WeakMap<K, V>;unsafe fn long_ref_from_abi(js: Self::Abi) -> Self::Anchor
impl<K, V> OptionFromWasmAbi for WeakMap<K, V>
fn is_none(abi: &Self::Abi) -> bool
impl<K, V> OptionIntoWasmAbi for WeakMap<K, V>
fn none() -> Self::Abi
impl<K, V> Promising for WeakMap<K, V>
type Resolution = WeakMap<K, V>;
impl<K, V> RefFromWasmAbi for WeakMap<K, V>
type Abi = <JsValue as RefFromWasmAbi>::Abi;type Anchor = ManuallyDrop<WeakMap<K, V>>;unsafe fn ref_from_abi(js: Self::Abi) -> Self::Anchor
impl<K, V> WasmDescribe for WeakMap<K, V>
fn describe()
impl<K, V, __UpcastTarget0, __UpcastTarget1> UpcastFrom<WeakMap<K, V>> for WeakMap<__UpcastTarget0, __UpcastTarget1>
where
__UpcastTarget0: UpcastFrom<K>,
__UpcastTarget1: UpcastFrom<V>,
impl<K: Clone, V: Clone> Clone for WeakMap<K, V>
fn clone(&self) -> Self
impl<K: Debug, V: Debug> Debug for WeakMap<K, V>
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl<K: Eq, V: Eq> Eq for WeakMap<K, V>
impl<K: PartialEq, V: PartialEq> PartialEq for WeakMap<K, V>
fn eq(&self, other: &Self) -> bool