Enum lightningcss::selector::Combinator
source · pub enum Combinator {
Child,
Descendant,
NextSibling,
LaterSibling,
PseudoElement,
SlotAssignment,
Part,
DeepDescendant,
Deep,
}
Expand description
A combinator.
Variants§
Child
Descendant
NextSibling
LaterSibling
PseudoElement
A dummy combinator we use to the left of pseudo-elements.
It serializes as the empty string, and acts effectively as a child combinator in most cases. If we ever actually start using a child combinator for this, we will need to fix up the way hashes are computed for revalidation selectors.
SlotAssignment
Another combinator used for ::slotted(), which represent the jump from a node to its assigned slot.
Part
Another combinator used for ::part()
, which represents the jump from
the part to the containing shadow host.
DeepDescendant
Non-standard Vue >>> combinator. https://vue-loader.vuejs.org/guide/scoped-css.html#deep-selectors
Deep
Non-standard /deep/ combinator. Appeared in early versions of the css-scoping-1 specification: https://www.w3.org/TR/2014/WD-css-scoping-1-20140403/#deep-combinator And still supported as an alias for >>> by Vue.
Implementations§
source§impl Combinator
impl Combinator
sourcepub fn is_ancestor(&self) -> bool
pub fn is_ancestor(&self) -> bool
Returns true if this combinator is a child or descendant combinator.
sourcepub fn is_pseudo_element(&self) -> bool
pub fn is_pseudo_element(&self) -> bool
Returns true if this combinator is a pseudo-element combinator.
sourcepub fn is_sibling(&self) -> bool
pub fn is_sibling(&self) -> bool
Returns true if this combinator is a next- or later-sibling combinator.
pub fn is_tree_combinator(&self) -> bool
Trait Implementations§
source§impl Clone for Combinator
impl Clone for Combinator
source§fn clone(&self) -> Combinator
fn clone(&self) -> Combinator
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for Combinator
impl Debug for Combinator
source§impl<'de> Deserialize<'de> for Combinator
impl<'de> Deserialize<'de> for Combinator
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<Combinator, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>( __deserializer: __D ) -> Result<Combinator, <__D as Deserializer<'de>>::Error>where __D: Deserializer<'de>,
source§impl Hash for Combinator
impl Hash for Combinator
source§impl JsonSchema for Combinator
impl JsonSchema for Combinator
source§fn schema_name() -> String
fn schema_name() -> String
source§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref
keyword. Read moresource§impl PartialEq<Combinator> for Combinator
impl PartialEq<Combinator> for Combinator
source§fn eq(&self, other: &Combinator) -> bool
fn eq(&self, other: &Combinator) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for Combinator
impl Serialize for Combinator
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>( &self, __serializer: __S ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where __S: Serializer,
source§impl ToCss for Combinator
impl ToCss for Combinator
source§impl ToCss for Combinator
impl ToCss for Combinator
source§fn to_css<W>(
&self,
dest: &mut Printer<'_, '_, '_, W>
) -> Result<(), PrinterError>where
W: Write,
fn to_css<W>( &self, dest: &mut Printer<'_, '_, '_, W> ) -> Result<(), PrinterError>where W: Write,
self
in CSS syntax, writing to dest
.source§fn to_css_string(
&self,
options: PrinterOptions<'_>
) -> Result<String, PrinterError>
fn to_css_string( &self, options: PrinterOptions<'_> ) -> Result<String, PrinterError>
self
in CSS syntax and return a string. Read more