pub struct ElementInfo {Show 15 fields
pub tag_name: Arc<str>,
pub id: Option<Arc<str>>,
pub classes: Arc<[Arc<str>]>,
pub attributes: Arc<[(Arc<str>, Arc<str>)]>,
pub element_index: usize,
pub element_count: usize,
pub type_index: usize,
pub type_count: usize,
pub previous_siblings: ElementChain,
pub has_parent: bool,
pub checked: bool,
pub lang: Option<Arc<str>>,
pub is_empty: bool,
pub hovered: bool,
pub active: bool,
}Expand description
A single element’s identity as the selector matcher sees it.
The string-bearing fields are shared through Arc because the same element
is described many times per layout build: once when its parent builds the
sibling list and again inside the ancestor/sibling ElementChain links.
Cheap Clone keeps that repeated description from re-cloning every
attribute string on the hot path.
Fields§
§tag_name: Arc<str>§id: Option<Arc<str>>§classes: Arc<[Arc<str>]>§attributes: Arc<[(Arc<str>, Arc<str>)]>§element_index: usizeOne-based index among element siblings.
element_count: usizeNumber of element siblings including this element.
type_index: usizeOne-based index among siblings with the same tag name.
type_count: usizeNumber of siblings with the same tag name.
previous_siblings: ElementChainElement siblings preceding this element in document order, nearest
first. Links are shared through Arc, so building it per sibling is
O(1).
has_parent: boolWhether this element has a parent element.
The tree root is an element with no parent, and structural
pseudo-classes such as :first-child must not match it.
checked: boolWhether a checkbox or radio is currently checked. This is live
checkedness, not the checked content attribute, which is
defaultChecked and does not affect :checked.
lang: Option<Arc<str>>The language tag in effect for this element: its own lang attribute, or
failing that the nearest ancestor’s. :lang() matches against this.
is_empty: boolWhether this element is :empty under the Selectors 4 definition:
no element children, and no text node with non-empty data. Comments and
processing instructions do not count.
hovered: boolWhether this element or an ancestor is under the pointer.
active: boolWhether this element or an ancestor is the active (pressed) target.
Trait Implementations§
Source§impl Clone for ElementInfo
impl Clone for ElementInfo
Source§fn clone(&self) -> ElementInfo
fn clone(&self) -> ElementInfo
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ElementInfo
impl Debug for ElementInfo
Source§impl Default for ElementInfo
impl Default for ElementInfo
Source§fn default() -> ElementInfo
fn default() -> ElementInfo
Auto Trait Implementations§
impl Freeze for ElementInfo
impl RefUnwindSafe for ElementInfo
impl Send for ElementInfo
impl Sync for ElementInfo
impl Unpin for ElementInfo
impl UnsafeUnpin for ElementInfo
impl UnwindSafe for ElementInfo
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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> ⓘ
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> ⓘ
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 more§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().