pub struct SelectorSegment {
pub matcher: RecordMatcher,
pub filters: Vec<PropertyFilter>,
pub pseudo: Vec<PseudoSelector>,
pub combinator: Option<Combinator>,
}Expand description
A single segment in a selector chain.
Fields§
§matcher: RecordMatcherWhat type of record to match.
filters: Vec<PropertyFilter>Property filters [prop op value].
pseudo: Vec<PseudoSelector>Pseudo-selectors like :connected, :has().
combinator: Option<Combinator>How this segment connects to the next (if any).
Implementations§
Source§impl SelectorSegment
impl SelectorSegment
Sourcepub fn from_matcher(matcher: RecordMatcher) -> Self
pub fn from_matcher(matcher: RecordMatcher) -> Self
Create a segment from a matcher.
Sourcepub fn with_filter(self, filter: PropertyFilter) -> Self
pub fn with_filter(self, filter: PropertyFilter) -> Self
Add a property filter to this segment.
Sourcepub fn with_pseudo(self, pseudo: PseudoSelector) -> Self
pub fn with_pseudo(self, pseudo: PseudoSelector) -> Self
Add a pseudo-selector to this segment.
Sourcepub fn with_combinator(self, combinator: Combinator) -> Self
pub fn with_combinator(self, combinator: Combinator) -> Self
Set the combinator for this segment.
Trait Implementations§
Source§impl Clone for SelectorSegment
impl Clone for SelectorSegment
Source§fn clone(&self) -> SelectorSegment
fn clone(&self) -> SelectorSegment
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SelectorSegment
impl RefUnwindSafe for SelectorSegment
impl Send for SelectorSegment
impl Sync for SelectorSegment
impl Unpin for SelectorSegment
impl UnwindSafe for SelectorSegment
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§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 more