Struct script::dom::htmlcollection::HTMLCollection
source · #[repr(C)]pub struct HTMLCollection {
reflector_: Reflector,
root: Dom<Node>,
filter: Box<dyn CollectionFilter + 'static>,
cached_version: Cell<u64>,
cached_cursor_element: MutNullableDom<Element>,
cached_cursor_index: Cell<OptionU32>,
cached_length: Cell<OptionU32>,
}
Fields§
§reflector_: Reflector
§root: Dom<Node>
§filter: Box<dyn CollectionFilter + 'static>
§cached_version: Cell<u64>
§cached_cursor_element: MutNullableDom<Element>
§cached_cursor_index: Cell<OptionU32>
§cached_length: Cell<OptionU32>
Implementations§
source§impl HTMLCollection
impl HTMLCollection
pub fn type_id(&self) -> &'static HTMLCollectionTypeId
source§impl HTMLCollection
impl HTMLCollection
pub fn new_inherited(
root: &Node,
filter: Box<dyn CollectionFilter + 'static>
) -> HTMLCollection
sourcepub fn always_empty(window: &Window, root: &Node) -> Root<Dom<Self>>
pub fn always_empty(window: &Window, root: &Node) -> Root<Dom<Self>>
Returns a collection which is always empty.
pub fn new(
window: &Window,
root: &Node,
filter: Box<dyn CollectionFilter + 'static>
) -> Root<Dom<HTMLCollection>>
pub fn create(
window: &Window,
root: &Node,
filter: Box<dyn CollectionFilter + 'static>
) -> Root<Dom<HTMLCollection>>
fn validate_cache(&self)
fn set_cached_cursor(
&self,
index: u32,
element: Option<Root<Dom<Element>>>
) -> Option<Root<Dom<Element>>>
pub fn by_qualified_name(
window: &Window,
root: &Node,
qualified_name: LocalName
) -> Root<Dom<HTMLCollection>>
fn match_element(elem: &Element, qualified_name: &LocalName) -> bool
pub fn by_tag_name_ns(
window: &Window,
root: &Node,
tag: DOMString,
maybe_ns: Option<DOMString>
) -> Root<Dom<HTMLCollection>>
pub fn by_qual_tag_name(
window: &Window,
root: &Node,
qname: QualName
) -> Root<Dom<HTMLCollection>>
pub fn by_class_name(
window: &Window,
root: &Node,
classes: DOMString
) -> Root<Dom<HTMLCollection>>
pub fn by_atomic_class_name(
window: &Window,
root: &Node,
classes: Vec<Atom>
) -> Root<Dom<HTMLCollection>>
pub fn children(window: &Window, root: &Node) -> Root<Dom<HTMLCollection>>
pub fn elements_iter_after<'a>(
&'a self,
after: &'a Node
) -> impl Iterator<Item = Root<Dom<Element>>> + 'a
pub fn elements_iter<'a>(
&'a self
) -> impl Iterator<Item = Root<Dom<Element>>> + 'a
pub fn elements_iter_before<'a>(
&'a self,
before: &'a Node
) -> impl Iterator<Item = Root<Dom<Element>>> + 'a
pub fn root_node(&self) -> Root<Dom<Node>>
Trait Implementations§
source§impl Castable for HTMLCollection
impl Castable for HTMLCollection
source§impl DomObject for HTMLCollection
impl DomObject for HTMLCollection
source§impl DomObjectWrap for HTMLCollection
impl DomObjectWrap for HTMLCollection
source§const WRAP: unsafe fn(_: SafeJSContext, _: &GlobalScope, _: Option<HandleObject<'_>>, _: Box<Self>) -> Root<Dom<Self>> = {dom::bindings::codegen::Bindings::HTMLCollectionBinding::HTMLCollectionBinding::Wrap as for<'a, 'b> unsafe fn(script_runtime::JSContext, &'a dom::globalscope::GlobalScope, std::option::Option<js::rust::Handle<'b, *mut js::jsapi::JSObject>>, std::boxed::Box<dom::htmlcollection::HTMLCollection>) -> dom::bindings::root::Root<dom::bindings::root::Dom<dom::htmlcollection::HTMLCollection>>}
const WRAP: unsafe fn(_: SafeJSContext, _: &GlobalScope, _: Option<HandleObject<'_>>, _: Box<Self>) -> Root<Dom<Self>> = {dom::bindings::codegen::Bindings::HTMLCollectionBinding::HTMLCollectionBinding::Wrap as for<'a, 'b> unsafe fn(script_runtime::JSContext, &'a dom::globalscope::GlobalScope, std::option::Option<js::rust::Handle<'b, *mut js::jsapi::JSObject>>, std::boxed::Box<dom::htmlcollection::HTMLCollection>) -> dom::bindings::root::Root<dom::bindings::root::Dom<dom::htmlcollection::HTMLCollection>>}
Function pointer to the general wrap function type
source§impl HTMLCollectionMethods for HTMLCollection
impl HTMLCollectionMethods for HTMLCollection
fn Length(&self) -> u32
fn Item(&self, index: u32) -> Option<Root<Dom<Element>>>
fn NamedItem(&self, key: DOMString) -> Option<Root<Dom<Element>>>
fn IndexedGetter(&self, index: u32) -> Option<Root<Dom<Element>>>
fn NamedGetter(&self, name: DOMString) -> Option<Root<Dom<Element>>>
fn SupportedPropertyNames(&self) -> Vec<DOMString> ⓘ
source§impl HasParent for HTMLCollection
impl HasParent for HTMLCollection
source§impl IDLInterface for HTMLCollection
impl IDLInterface for HTMLCollection
source§impl JSTraceable for HTMLCollection
impl JSTraceable for HTMLCollection
source§impl MallocSizeOf for HTMLCollection
impl MallocSizeOf for HTMLCollection
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.
source§impl MutDomObject for HTMLCollection
impl MutDomObject for HTMLCollection
source§unsafe fn init_reflector(&self, obj: *mut JSObject)
unsafe fn init_reflector(&self, obj: *mut JSObject)
Initializes the Reflector
source§impl PartialEq<HTMLCollection> for HTMLCollection
impl PartialEq<HTMLCollection> for HTMLCollection
source§fn eq(&self, other: &HTMLCollection) -> bool
fn eq(&self, other: &HTMLCollection) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl ToJSValConvertible for HTMLCollection
impl ToJSValConvertible for HTMLCollection
impl DerivedFrom<HTMLCollection> for HTMLCollection
impl DerivedFrom<HTMLCollection> for HTMLFormControlsCollection
impl DerivedFrom<HTMLCollection> for HTMLOptionsCollection
Auto Trait Implementations§
impl !RefUnwindSafe for HTMLCollection
impl !Send for HTMLCollection
impl !Sync for HTMLCollection
impl Unpin for HTMLCollection
impl !UnwindSafe for HTMLCollection
Blanket Implementations§
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> MaybeBoxed<Box<T, Global>> for T
impl<T> MaybeBoxed<Box<T, Global>> for T
source§fn maybe_boxed(self) -> Box<T, Global>
fn maybe_boxed(self) -> Box<T, Global>
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