Enum lightningcss::selector::Combinator
source · pub enum Combinator {
Child,
Descendant,
NextSibling,
LaterSibling,
PseudoElement,
SlotAssignment,
Part,
}
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.
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
Returns a copy 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 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>,
Deserialize this value from the given Serde deserializer. Read more
source§impl JsonSchema for Combinator
impl JsonSchema for Combinator
source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
source§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$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
This method tests for
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,
Serialize this value into the given Serde serializer. Read more
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,
Serialize
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>
Serialize
self
in CSS syntax and return a string. Read moreimpl Copy for Combinator
impl Eq for Combinator
impl StructuralEq for Combinator
impl StructuralPartialEq for Combinator
Auto Trait Implementations§
impl RefUnwindSafe for Combinator
impl Send for Combinator
impl Sync for Combinator
impl Unpin for Combinator
impl UnwindSafe for Combinator
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
§impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere W: DeserializeWith<F, T, D>, D: Fallible + ?Sized, F: ?Sized,
§fn deserialize(
&self,
deserializer: &mut D
) -> Result<With<T, W>, <D as Fallible>::Error>
fn deserialize( &self, deserializer: &mut D ) -> Result<With<T, W>, <D as Fallible>::Error>
Deserializes using the given deserializer