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§
source§impl<T> Root<T>where
T: StableTraceObject + 'static,
impl<T> Root<T>where
T: StableTraceObject + 'static,
source§impl<T: Castable> Root<Dom<T>>
impl<T: Castable> Root<Dom<T>>
source§impl<T> Root<MaybeUnreflectedDom<T>>where
T: DomObject,
impl<T> Root<MaybeUnreflectedDom<T>>where
T: DomObject,
source§impl<T> Root<MaybeUnreflectedDom<T>>where
T: MutDomObject,
impl<T> Root<MaybeUnreflectedDom<T>>where
T: MutDomObject,
Trait Implementations§
source§impl<T> Drop for Root<T>where
T: StableTraceObject,
impl<T> Drop for Root<T>where
T: StableTraceObject,
source§impl Element for Root<Dom<Element>>
impl Element for Root<Dom<Element>>
type Impl = SelectorImpl
source§fn opaque(&self) -> OpaqueElement
fn opaque(&self) -> OpaqueElement
Converts self into an opaque representation.
fn parent_element(&self) -> Option<Root<Dom<Element>>>
source§fn parent_node_is_shadow_root(&self) -> bool
fn parent_node_is_shadow_root(&self) -> bool
Whether the parent node of this element is a shadow root.
source§fn containing_shadow_host(&self) -> Option<Self>
fn containing_shadow_host(&self) -> Option<Self>
The host of the containing shadow root, if any.
source§fn is_pseudo_element(&self) -> bool
fn is_pseudo_element(&self) -> bool
Whether we’re matching on a pseudo-element.
fn match_pseudo_element( &self, _pseudo: &PseudoElement, _context: &mut MatchingContext<'_, Self::Impl>, ) -> bool
fn attr_matches( &self, ns: &NamespaceConstraint<&Namespace>, local_name: &LocalName, operation: &AttrSelectorOperation<&AtomString>, ) -> bool
source§fn is_root(&self) -> bool
fn is_root(&self) -> bool
Returns whether this element matches
:root
,
i.e. whether it is the root element of a document. Read morefn has_local_name(&self, local_name: &LocalName) -> bool
source§fn has_namespace(&self, ns: &Namespace) -> bool
fn has_namespace(&self, ns: &Namespace) -> bool
Empty string for no namespace
source§fn is_same_type(&self, other: &Self) -> bool
fn is_same_type(&self, other: &Self) -> bool
Whether this element and the
other
element have the same local name and namespace.fn match_non_ts_pseudo_class( &self, pseudo_class: &NonTSPseudoClass, _: &mut MatchingContext<'_, Self::Impl>, ) -> bool
fn has_id(&self, id: &AtomIdent, case_sensitivity: CaseSensitivity) -> bool
fn is_part(&self, _name: &AtomIdent) -> bool
source§fn imported_part(&self, _: &AtomIdent) -> Option<AtomIdent>
fn imported_part(&self, _: &AtomIdent) -> Option<AtomIdent>
Returns the mapping from the
exportparts
attribute in the reverse
direction, that is, in an outer-tree -> inner-tree direction.fn has_class(&self, name: &AtomIdent, case_sensitivity: CaseSensitivity) -> bool
fn is_html_element_in_html_document(&self) -> bool
source§fn is_html_slot_element(&self) -> bool
fn is_html_slot_element(&self) -> bool
Returns whether the element is an HTML element.
source§fn apply_selector_flags(&self, flags: ElementSelectorFlags)
fn apply_selector_flags(&self, flags: ElementSelectorFlags)
Sets selector flags on the elemnt itself or the parent, depending on the
flags, which indicate what kind of work may need to be performed when
DOM state changes.
source§fn add_element_unique_hashes(&self, filter: &mut BloomFilter) -> bool
fn add_element_unique_hashes(&self, filter: &mut BloomFilter) -> bool
Add hashes unique to this element to the given filter, returning true
if any got added.
fn has_custom_state(&self, _name: &AtomIdent) -> bool
source§fn pseudo_element_originating_element(&self) -> Option<Self>
fn pseudo_element_originating_element(&self) -> Option<Self>
The parent of a given pseudo-element, after matching a pseudo-element
selector. Read more
fn has_attr_in_no_namespace( &self, local_name: &<Self::Impl as SelectorImpl>::LocalName, ) -> bool
source§fn assigned_slot(&self) -> Option<Self>
fn assigned_slot(&self) -> Option<Self>
Returns the assigned element this element is assigned to. Read more
source§fn ignores_nth_child_selectors(&self) -> bool
fn ignores_nth_child_selectors(&self) -> bool
Returns whether this element should ignore matching nth child
selector.
source§impl<T: DomObject + IDLInterface> FromJSValConvertible for Root<Dom<T>>
impl<T: DomObject + IDLInterface> FromJSValConvertible for Root<Dom<T>>
source§unsafe fn from_jsval(
cx: *mut JSContext,
value: HandleValue<'_>,
_config: Self::Config,
) -> Result<ConversionResult<Root<Dom<T>>>, ()>
unsafe fn from_jsval( cx: *mut JSContext, value: HandleValue<'_>, _config: Self::Config, ) -> Result<ConversionResult<Root<Dom<T>>>, ()>
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.source§impl<T> MallocSizeOf for Root<Dom<T>>where
T: DomObject + MallocSizeOf,
impl<T> MallocSizeOf for Root<Dom<T>>where
T: DomObject + MallocSizeOf,
source§fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
Measure the heap usage of all descendant heap-allocated structures, but
not the space taken up by the value itself.
Auto Trait Implementations§
impl<T> Freeze for Root<T>where
T: Freeze,
impl<T> !RefUnwindSafe for Root<T>
impl<T> !Send for Root<T>
impl<T> !Sync for Root<T>
impl<T> Unpin for Root<T>where
T: Unpin,
impl<T> !UnwindSafe for Root<T>
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> Filterable for T
impl<T> Filterable for T
source§fn filterable(
self,
filter_name: &'static str,
) -> RequestFilterDataProvider<T, fn(_: DataRequest<'_>) -> bool>
fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(_: DataRequest<'_>) -> bool>
Creates a filterable data provider with the given name for debugging. Read more
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§impl<T> MaybeBoxed<Box<T>> for T
impl<T> MaybeBoxed<Box<T>> for T
source§fn maybe_boxed(self) -> Box<T>
fn maybe_boxed(self) -> Box<T>
Convert
source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert