pub enum Selector {
Element(ElementType),
Id(String),
Universal,
Attribute(AttributeSelector),
Pseudo(PseudoSelector),
Compound(Vec<Selector>),
Combinator {
left: Box<Selector>,
combinator: CombinatorType,
right: Box<Selector>,
},
Union(Vec<Selector>),
Not(Box<Selector>),
Has(Box<Selector>),
}Expand description
Parsed query AST node
Variants§
Element(ElementType)
Element type selector: component, pin, net, etc.
Id(String)
ID selector: #U1, #VCC
Universal
Universal selector: *
Attribute(AttributeSelector)
Attribute selector: [attr=value]
Pseudo(PseudoSelector)
Pseudo-selector: :connected, :power
Compound(Vec<Selector>)
Compound selector (multiple conditions on same element)
Combinator
Combinator: A B, A > B, A >> B
Union(Vec<Selector>)
Union: A, B
Not(Box<Selector>)
Negation: :not(A)
Has(Box<Selector>)
Has child: :has(A)
Implementations§
Source§impl Selector
impl Selector
Sourcepub fn has_result_modifier(&self) -> bool
pub fn has_result_modifier(&self) -> bool
Check if this selector has any result modifiers (count, limit, etc.)
Sourcepub fn get_result_modifiers(&self) -> Vec<&PseudoSelector>
pub fn get_result_modifiers(&self) -> Vec<&PseudoSelector>
Extract result modifiers from this selector
Trait Implementations§
impl StructuralPartialEq for Selector
Auto Trait Implementations§
impl Freeze for Selector
impl RefUnwindSafe for Selector
impl Send for Selector
impl Sync for Selector
impl Unpin for Selector
impl UnwindSafe for Selector
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