Struct css_knife::visit_selectors::ClassVisitor
source · pub struct ClassVisitor { /* private fields */ }
Implementations§
Trait Implementations§
source§impl Clone for ClassVisitor
impl Clone for ClassVisitor
source§fn clone(&self) -> ClassVisitor
fn clone(&self) -> ClassVisitor
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 Default for ClassVisitor
impl Default for ClassVisitor
source§fn default() -> ClassVisitor
fn default() -> ClassVisitor
Returns the “default value” for a type. Read more
source§impl PartialEq for ClassVisitor
impl PartialEq for ClassVisitor
source§fn eq(&self, other: &ClassVisitor) -> bool
fn eq(&self, other: &ClassVisitor) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<'i> Visitor<'i> for ClassVisitor
impl<'i> Visitor<'i> for ClassVisitor
source§fn visit_types(&self) -> VisitTypes
fn visit_types(&self) -> VisitTypes
Returns the types of values that this visitor should visit. By default, it returns
Self::TYPES
, but this can be overridden to change the value at runtime.source§fn visit_selector(
&mut self,
selector: &mut Selector<'i>
) -> Result<(), Self::Error>
fn visit_selector( &mut self, selector: &mut Selector<'i> ) -> Result<(), Self::Error>
Visits a selector.
source§fn visit_dashed_ident(
&mut self,
ident: &mut DashedIdent<'_>
) -> Result<(), Self::Error>
fn visit_dashed_ident( &mut self, ident: &mut DashedIdent<'_> ) -> Result<(), Self::Error>
Visits a dashed ident.
source§fn visit_rule_list(
&mut self,
rules: &mut CssRuleList<'i, T>
) -> Result<(), Self::Error>
fn visit_rule_list( &mut self, rules: &mut CssRuleList<'i, T> ) -> Result<(), Self::Error>
Visits a rule list.
source§fn visit_declaration_block(
&mut self,
decls: &mut DeclarationBlock<'i>
) -> Result<(), Self::Error>
fn visit_declaration_block( &mut self, decls: &mut DeclarationBlock<'i> ) -> Result<(), Self::Error>
Visits a declaration block.
source§fn visit_property(
&mut self,
property: &mut Property<'i>
) -> Result<(), Self::Error>
fn visit_property( &mut self, property: &mut Property<'i> ) -> Result<(), Self::Error>
Visits a property.
source§fn visit_length(&mut self, length: &mut LengthValue) -> Result<(), Self::Error>
fn visit_length(&mut self, length: &mut LengthValue) -> Result<(), Self::Error>
Visits a length.
source§fn visit_resolution(
&mut self,
resolution: &mut Resolution
) -> Result<(), Self::Error>
fn visit_resolution( &mut self, resolution: &mut Resolution ) -> Result<(), Self::Error>
Visits a resolution.
source§fn visit_custom_ident(
&mut self,
ident: &mut CustomIdent<'_>
) -> Result<(), Self::Error>
fn visit_custom_ident( &mut self, ident: &mut CustomIdent<'_> ) -> Result<(), Self::Error>
Visits a custom ident.
source§fn visit_variable(&mut self, var: &mut Variable<'i>) -> Result<(), Self::Error>
fn visit_variable(&mut self, var: &mut Variable<'i>) -> Result<(), Self::Error>
Visits a variable reference.
source§fn visit_environment_variable(
&mut self,
env: &mut EnvironmentVariable<'i>
) -> Result<(), Self::Error>
fn visit_environment_variable( &mut self, env: &mut EnvironmentVariable<'i> ) -> Result<(), Self::Error>
Visits an environment variable reference.
source§fn visit_media_list(
&mut self,
media: &mut MediaList<'i>
) -> Result<(), Self::Error>
fn visit_media_list( &mut self, media: &mut MediaList<'i> ) -> Result<(), Self::Error>
Visits a media query list.
source§fn visit_media_query(
&mut self,
query: &mut MediaQuery<'i>
) -> Result<(), Self::Error>
fn visit_media_query( &mut self, query: &mut MediaQuery<'i> ) -> Result<(), Self::Error>
Visits a media query.
source§fn visit_media_feature(
&mut self,
feature: &mut QueryFeature<'i, MediaFeatureId>
) -> Result<(), Self::Error>
fn visit_media_feature( &mut self, feature: &mut QueryFeature<'i, MediaFeatureId> ) -> Result<(), Self::Error>
Visits a media feature.
source§fn visit_media_feature_value(
&mut self,
value: &mut MediaFeatureValue<'i>
) -> Result<(), Self::Error>
fn visit_media_feature_value( &mut self, value: &mut MediaFeatureValue<'i> ) -> Result<(), Self::Error>
Visits a media feature value.
source§fn visit_supports_condition(
&mut self,
condition: &mut SupportsCondition<'i>
) -> Result<(), Self::Error>
fn visit_supports_condition( &mut self, condition: &mut SupportsCondition<'i> ) -> Result<(), Self::Error>
Visits a supports condition.
source§fn visit_selector_list(
&mut self,
selectors: &mut SelectorList<'i, Selectors>
) -> Result<(), Self::Error>
fn visit_selector_list( &mut self, selectors: &mut SelectorList<'i, Selectors> ) -> Result<(), Self::Error>
Visits a selector list.
source§fn visit_function(
&mut self,
function: &mut Function<'i>
) -> Result<(), Self::Error>
fn visit_function( &mut self, function: &mut Function<'i> ) -> Result<(), Self::Error>
Visits a custom function.
source§fn visit_token_list(
&mut self,
tokens: &mut TokenList<'i>
) -> Result<(), Self::Error>
fn visit_token_list( &mut self, tokens: &mut TokenList<'i> ) -> Result<(), Self::Error>
Visits a token list.
source§fn visit_token(
&mut self,
token: &mut TokenOrValue<'i>
) -> Result<(), Self::Error>
fn visit_token( &mut self, token: &mut TokenOrValue<'i> ) -> Result<(), Self::Error>
Visits a token or value in an unparsed property.
impl Eq for ClassVisitor
impl StructuralEq for ClassVisitor
impl StructuralPartialEq for ClassVisitor
Auto Trait Implementations§
impl RefUnwindSafe for ClassVisitor
impl Send for ClassVisitor
impl Sync for ClassVisitor
impl Unpin for ClassVisitor
impl UnwindSafe for ClassVisitor
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.
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
§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
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Gets the layout of the type.
§impl<D> OwoColorize for D
impl<D> OwoColorize for D
§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where C: Color,
Set the foreground color generically Read more
§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where C: Color,
Set the background color generically. Read more
§fn on_yellow<'a>(&'a self) -> BgColorDisplay<'a, Yellow, Self>
fn on_yellow<'a>(&'a self) -> BgColorDisplay<'a, Yellow, Self>
Change the background color to yellow
§fn magenta<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>
fn magenta<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>
Change the foreground color to magenta
§fn on_magenta<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
fn on_magenta<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
Change the background color to magenta
§fn on_purple<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
fn on_purple<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
Change the background color to purple
§fn default_color<'a>(&'a self) -> FgColorDisplay<'a, Default, Self>
fn default_color<'a>(&'a self) -> FgColorDisplay<'a, Default, Self>
Change the foreground color to the terminal default
§fn on_default_color<'a>(&'a self) -> BgColorDisplay<'a, Default, Self>
fn on_default_color<'a>(&'a self) -> BgColorDisplay<'a, Default, Self>
Change the background color to the terminal default
§fn bright_black<'a>(&'a self) -> FgColorDisplay<'a, BrightBlack, Self>
fn bright_black<'a>(&'a self) -> FgColorDisplay<'a, BrightBlack, Self>
Change the foreground color to bright black
§fn on_bright_black<'a>(&'a self) -> BgColorDisplay<'a, BrightBlack, Self>
fn on_bright_black<'a>(&'a self) -> BgColorDisplay<'a, BrightBlack, Self>
Change the background color to bright black
§fn bright_red<'a>(&'a self) -> FgColorDisplay<'a, BrightRed, Self>
fn bright_red<'a>(&'a self) -> FgColorDisplay<'a, BrightRed, Self>
Change the foreground color to bright red
§fn on_bright_red<'a>(&'a self) -> BgColorDisplay<'a, BrightRed, Self>
fn on_bright_red<'a>(&'a self) -> BgColorDisplay<'a, BrightRed, Self>
Change the background color to bright red
§fn bright_green<'a>(&'a self) -> FgColorDisplay<'a, BrightGreen, Self>
fn bright_green<'a>(&'a self) -> FgColorDisplay<'a, BrightGreen, Self>
Change the foreground color to bright green
§fn on_bright_green<'a>(&'a self) -> BgColorDisplay<'a, BrightGreen, Self>
fn on_bright_green<'a>(&'a self) -> BgColorDisplay<'a, BrightGreen, Self>
Change the background color to bright green
§fn bright_yellow<'a>(&'a self) -> FgColorDisplay<'a, BrightYellow, Self>
fn bright_yellow<'a>(&'a self) -> FgColorDisplay<'a, BrightYellow, Self>
Change the foreground color to bright yellow
§fn on_bright_yellow<'a>(&'a self) -> BgColorDisplay<'a, BrightYellow, Self>
fn on_bright_yellow<'a>(&'a self) -> BgColorDisplay<'a, BrightYellow, Self>
Change the background color to bright yellow
§fn bright_blue<'a>(&'a self) -> FgColorDisplay<'a, BrightBlue, Self>
fn bright_blue<'a>(&'a self) -> FgColorDisplay<'a, BrightBlue, Self>
Change the foreground color to bright blue
§fn on_bright_blue<'a>(&'a self) -> BgColorDisplay<'a, BrightBlue, Self>
fn on_bright_blue<'a>(&'a self) -> BgColorDisplay<'a, BrightBlue, Self>
Change the background color to bright blue
§fn bright_magenta<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
fn bright_magenta<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
Change the foreground color to bright magenta
§fn on_bright_magenta<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
fn on_bright_magenta<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
Change the background color to bright magenta
§fn bright_purple<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
fn bright_purple<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
Change the foreground color to bright purple
§fn on_bright_purple<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
fn on_bright_purple<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
Change the background color to bright purple
§fn bright_cyan<'a>(&'a self) -> FgColorDisplay<'a, BrightCyan, Self>
fn bright_cyan<'a>(&'a self) -> FgColorDisplay<'a, BrightCyan, Self>
Change the foreground color to bright cyan
§fn on_bright_cyan<'a>(&'a self) -> BgColorDisplay<'a, BrightCyan, Self>
fn on_bright_cyan<'a>(&'a self) -> BgColorDisplay<'a, BrightCyan, Self>
Change the background color to bright cyan
§fn bright_white<'a>(&'a self) -> FgColorDisplay<'a, BrightWhite, Self>
fn bright_white<'a>(&'a self) -> FgColorDisplay<'a, BrightWhite, Self>
Change the foreground color to bright white
§fn on_bright_white<'a>(&'a self) -> BgColorDisplay<'a, BrightWhite, Self>
fn on_bright_white<'a>(&'a self) -> BgColorDisplay<'a, BrightWhite, Self>
Change the background color to bright white
§fn blink_fast<'a>(&'a self) -> BlinkFastDisplay<'a, Self>
fn blink_fast<'a>(&'a self) -> BlinkFastDisplay<'a, Self>
Make the text blink (but fast!)
Hide the text
§fn strikethrough<'a>(&'a self) -> StrikeThroughDisplay<'a, Self>
fn strikethrough<'a>(&'a self) -> StrikeThroughDisplay<'a, Self>
Cross out the text
§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where Color: DynColor,
Set the foreground color at runtime. Only use if you do not know which color will be used at
compile-time. If the color is constant, use either
OwoColorize::fg
or
a color-specific method, such as OwoColorize::green
, Read more§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where Color: DynColor,
Set the background color at runtime. Only use if you do not know what color to use at
compile-time. If the color is constant, use either
OwoColorize::bg
or
a color-specific method, such as OwoColorize::on_yellow
, Read more§fn fg_rgb<const R: u8, const G: u8, const B: u8>(
&self
) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>
fn fg_rgb<const R: u8, const G: u8, const B: u8>( &self ) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>
Set the foreground color to a specific RGB value.
§fn bg_rgb<const R: u8, const G: u8, const B: u8>(
&self
) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>
fn bg_rgb<const R: u8, const G: u8, const B: u8>( &self ) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>
Set the background color to a specific RGB value.
§fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>
fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>
Sets the foreground color to an RGB value.
§fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>
fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>
Sets the background color to an RGB value.