Struct script::dom::bindings::root::Root

source ·
pub struct Root<T: StableTraceObject> {
    value: T,
    root_list: *const RootCollection,
}
Expand description

A rooted value.

Fields

value: T

The value to root.

root_list: *const RootCollection

List that ensures correct dynamic root ordering

Implementations

Create a new stack-bounded root for the provided value. It cannot outlive its associated RootCollection, and it gives out references which cannot outlive this new Root.

Cast a DOM object root upwards to one of the interfaces it derives from.

Cast a DOM object root downwards to one of the interfaces it might implement.

Generate a new root from a reference

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
The resulting type after dereferencing.
Dereferences the value.
Executes the destructor for this type. Read more
Converts self into an opaque representation.
Whether the parent node of this element is a shadow root.
The host of the containing shadow root, if any.
Whether we’re matching on a pseudo-element.
Skips non-element nodes
Skips non-element nodes
Returns whether this element matches :root, i.e. whether it is the root element of a document. Read more
Returns whether this element matches :empty. Read more
Empty string for no namespace
Whether this element and the other element have the same local name and namespace.
Whether this element is a link.
Returns the mapping from the exportparts attribute in the reverse direction, that is, in an outer-tree -> inner-tree direction. Read more
Returns whether the element is an HTML element.
The parent of a given pseudo-element, after matching a pseudo-element selector. Read more
Returns the assigned element this element is assigned to. Read more
Returns whether this element should ignore matching nth child selector. Read more
Optional configurable behaviour switch; use () for no configuration.
Convert val to type Self. Optional configuration of type T can be passed as the option argument. If it returns Err(()), a JSAPI exception is pending. If it returns Ok(Failure(reason)), there is no pending JSAPI exception. Read more
Feeds this value into the given Hasher. Read more
Feeds a slice of this type into the given Hasher. Read more
Trace self.
Measure the heap usage of all descendant heap-allocated structures, but not the space taken up by the value itself. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
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
Compare self to key and return true if they are equal.
Compare self to key and return true if they are equal.

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 resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
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