Struct script::dom::promise::Promise

source ·
#[repr(C)]
pub struct Promise { reflector: Reflector, permanent_js_root: Heap<JSVal>, }

Fields

reflector: Reflectorpermanent_js_root: Heap<JSVal>

Since Promise values are natively reference counted without the knowledge of the SpiderMonkey GC, an explicit root for the reflector is stored while any native instance exists. This ensures that the reflector will never be GCed while native code could still interact with its native representation.

Implementations

Trait Implementations

Returns the receiver’s reflector.
Returns the global scope of the realm that the DomObject was created in.
Executes the destructor for this type. Read more

This is used in a type assertion to ensure that the source and webidls agree as to what the parent type is

Trace self.
Measure the heap usage of all descendant heap-allocated structures, but not the space taken up by the value itself. Read more
Initializes the Reflector
Convert self to a JSVal. JSAPI failure causes a panic.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

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

Convert
Convert
The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
Should always be Self
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more