Skip to main content

Registration

Struct Registration 

Source
pub struct Registration {
    pub target: WeakKey,
    pub held_value: Value,
    pub token: Option<Value>,
}
Expand description

One FinalizationRegistry.register call.

token is compared with SameValue, not SameValueZero, which is why it is kept as the original Value rather than normalised into a key.

Fields§

§target: WeakKey

The handle whose death fires the callback.

§held_value: Value

What the callback receives: the script’s held value, kept alive until it fires.

§token: Option<Value>

The cancellation token, if one was given.

Auto Trait Implementations§

§

impl !RefUnwindSafe for Registration

§

impl !Send for Registration

§

impl !Sync for Registration

§

impl !UnwindSafe for Registration

§

impl Forget for Registration

§

impl Freeze for Registration
where *const GcBox<JsObject> is !null: Freeze, *const GcBox<JsSymbol> is !null: Freeze, *const GcBox<JsString> is !null: Freeze, *const GcBox<BigInt> is !null: Freeze,

§

impl Move for Registration

§

impl Unpin for Registration
where *const GcBox<JsObject> is !null: Unpin, *const GcBox<JsSymbol> is !null: Unpin, *const GcBox<JsString> is !null: Unpin, *const GcBox<BigInt> is !null: Unpin,

§

impl UnsafeUnpin for Registration
where *const GcBox<JsObject> is !null: UnsafeUnpin, *const GcBox<JsSymbol> is !null: UnsafeUnpin, *const GcBox<JsString> is !null: UnsafeUnpin, *const GcBox<BigInt> is !null: UnsafeUnpin,

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

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

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.