pub enum WeakKey {
Object(WeakGc<JsObject>),
Symbol(WeakGc<JsSymbol>),
}Expand description
A key that can be held weakly: an object, or a symbol.
Both are heap allocations in this engine (Value::Symbol carries a Gc<JsSymbol>), so a
WeakGc holds either one just as well. Symbols became valid keys with the
symbols-as-weakmap-keys proposal, which is what test262 already tests.
Variants§
Implementations§
Source§impl WeakKey
impl WeakKey
Sourcepub fn is_expired(&self) -> bool
pub fn is_expired(&self) -> bool
Whether the allocation behind this key has been released.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for WeakKey
impl !Send for WeakKey
impl !Sync for WeakKey
impl !UnwindSafe for WeakKey
impl Forget for WeakKey
impl Freeze for WeakKey
impl Move for WeakKey
impl Unpin for WeakKey
impl UnsafeUnpin for WeakKey
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more