pub struct ElementRef<'a> {
pub tag: &'a str,
pub classes: &'a [String],
pub id: Option<&'a str>,
pub attributes: &'a [(String, String)],
pub children: &'a [ElementRef<'a>],
}Expand description
Light-weight reference to a DOM element for hierarchical selector matching.
Fields§
§tag: &'a str§classes: &'a [String]§id: Option<&'a str>§attributes: &'a [(String, String)]§children: &'a [ElementRef<'a>]Implementations§
Source§impl<'a> ElementRef<'a>
impl<'a> ElementRef<'a>
Sourcepub const fn new(
tag: &'a str,
classes: &'a [String],
id: Option<&'a str>,
attributes: &'a [(String, String)],
) -> Self
pub const fn new( tag: &'a str, classes: &'a [String], id: Option<&'a str>, attributes: &'a [(String, String)], ) -> Self
Constructs a basic ElementRef with no children.
Sourcepub const fn with_children(self, children: &'a [ElementRef<'a>]) -> Self
pub const fn with_children(self, children: &'a [ElementRef<'a>]) -> Self
Attaches child ElementRefs for :has() and structural evaluation.
Trait Implementations§
Source§impl<'a> Clone for ElementRef<'a>
impl<'a> Clone for ElementRef<'a>
impl<'a> Copy for ElementRef<'a>
Auto Trait Implementations§
impl<'a> Forget for ElementRef<'a>
impl<'a> Freeze for ElementRef<'a>
impl<'a> Move for ElementRef<'a>
impl<'a> RefUnwindSafe for ElementRef<'a>
impl<'a> Send for ElementRef<'a>
impl<'a> Sync for ElementRef<'a>
impl<'a> Unpin for ElementRef<'a>
impl<'a> UnsafeUnpin for ElementRef<'a>
impl<'a> UnwindSafe for ElementRef<'a>
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