lightningcss::traits

Trait ToCss

Source
pub trait ToCss {
    // Required method
    fn to_css<W>(
        &self,
        dest: &mut Printer<'_, '_, '_, W>,
    ) -> Result<(), PrinterError>
       where W: Write;

    // Provided method
    fn to_css_string(
        &self,
        options: PrinterOptions<'_>,
    ) -> Result<String, PrinterError> { ... }
}
Expand description

Trait for things the can serialize themselves in CSS syntax.

Required Methods§

Source

fn to_css<W>( &self, dest: &mut Printer<'_, '_, '_, W>, ) -> Result<(), PrinterError>
where W: Write,

Serialize self in CSS syntax, writing to dest.

Provided Methods§

Source

fn to_css_string( &self, options: PrinterOptions<'_>, ) -> Result<String, PrinterError>

Serialize self in CSS syntax and return a string.

(This is a convenience wrapper for to_css and probably should not be overridden.)

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<'a, T> ToCss for &'a T
where T: ToCss + ?Sized,

Source§

fn to_css<W>( &self, dest: &mut Printer<'_, '_, '_, W>, ) -> Result<(), PrinterError>
where W: Write,

Source§

impl<T: Array<Item = V>, V: ToCss> ToCss for SmallVec<T>

Source§

fn to_css<W>( &self, dest: &mut Printer<'_, '_, '_, W>, ) -> Result<(), PrinterError>
where W: Write,

Source§

impl<T: ToCss> ToCss for Option<T>

Source§

fn to_css<W>( &self, dest: &mut Printer<'_, '_, '_, W>, ) -> Result<(), PrinterError>
where W: Write,

Source§

impl<T: ToCss> ToCss for Box<T>

Source§

fn to_css<W>( &self, dest: &mut Printer<'_, '_, '_, W>, ) -> Result<(), PrinterError>
where W: Write,

Source§

impl<T: ToCss> ToCss for Vec<T>

Source§

fn to_css<W>( &self, dest: &mut Printer<'_, '_, '_, W>, ) -> Result<(), PrinterError>
where W: Write,

Implementors§

Source§

impl ToCss for MediaFeatureComparison

Source§

impl ToCss for MediaFeatureId

Source§

impl ToCss for Operator

Source§

impl ToCss for Qualifier

Source§

impl ToCss for AlignContent

Source§

impl ToCss for AlignItems

Source§

impl ToCss for AlignSelf

Source§

impl ToCss for BaselinePosition

Source§

impl ToCss for ContentDistribution

Source§

impl ToCss for ContentPosition

Source§

impl ToCss for GapValue

Source§

impl ToCss for JustifyContent

Source§

impl ToCss for JustifyItems

Source§

impl ToCss for JustifySelf

Source§

impl ToCss for LegacyJustify

Source§

impl ToCss for OverflowPosition

Source§

impl ToCss for SelfPosition

Source§

impl ToCss for AnimationComposition

Source§

impl ToCss for AnimationDirection

Source§

impl ToCss for AnimationFillMode

Source§

impl ToCss for AnimationIterationCount

Source§

impl ToCss for AnimationPlayState

Source§

impl ToCss for ScrollAxis

Source§

impl ToCss for Scroller

Source§

impl ToCss for TimelineRangeName

Source§

impl ToCss for BackgroundAttachment

Source§

impl ToCss for BackgroundClip

Source§

impl ToCss for BackgroundOrigin

Source§

impl ToCss for BackgroundRepeatKeyword

Source§

impl ToCss for BackgroundSize

Source§

impl ToCss for BorderSideWidth

Source§

impl ToCss for LineStyle

Source§

impl ToCss for BorderImageRepeatKeyword

Source§

impl ToCss for BorderImageSideWidth

Source§

impl ToCss for ContainerType

Source§

impl ToCss for UAEnvironmentVariable

Source§

impl ToCss for Display

Source§

impl ToCss for DisplayInside

Source§

impl ToCss for DisplayKeyword

Source§

impl ToCss for DisplayOutside

Source§

impl ToCss for Visibility

Source§

impl ToCss for CSSWideKeyword

Source§

impl ToCss for BoxAlign

Source§

impl ToCss for BoxDirection

Source§

impl ToCss for BoxLines

Source§

impl ToCss for BoxOrient

Source§

impl ToCss for BoxPack

Source§

impl ToCss for FlexDirection

Source§

impl ToCss for FlexItemAlign

Source§

impl ToCss for FlexLinePack

Source§

impl ToCss for FlexPack

Source§

impl ToCss for FlexWrap

Source§

impl ToCss for AbsoluteFontSize

Source§

impl ToCss for AbsoluteFontWeight

Source§

impl ToCss for FontSize

Source§

impl ToCss for FontStretch

Source§

impl ToCss for FontStretchKeyword

Source§

impl ToCss for lightningcss::properties::font::FontStyle

Source§

impl ToCss for FontVariantCaps

Source§

impl ToCss for FontWeight

Source§

impl ToCss for GenericFontFamily

Source§

impl ToCss for LineHeight

Source§

impl ToCss for RelativeFontSize

Source§

impl ToCss for VerticalAlign

Source§

impl ToCss for VerticalAlignKeyword

Source§

impl ToCss for GridLine<'_>

Source§

impl ToCss for GridTemplateAreas

Source§

impl ToCss for RepeatCount

Source§

impl ToCss for TrackBreadth

Source§

impl ToCss for TrackSize

Source§

impl ToCss for CounterStyle<'_>

Source§

impl ToCss for ListStylePosition

Source§

impl ToCss for MarkerSide

Source§

impl ToCss for PredefinedCounterStyle

Source§

impl ToCss for SymbolsType

Source§

impl ToCss for GeometryBox

Source§

impl ToCss for MaskBorderMode

Source§

impl ToCss for MaskClip

Source§

impl ToCss for MaskComposite

Source§

impl ToCss for MaskMode

Source§

impl ToCss for MaskType

Source§

impl ToCss for WebKitMaskComposite

Source§

impl ToCss for WebKitMaskSourceType

Source§

impl ToCss for OutlineStyle

Source§

impl ToCss for OverflowKeyword

Source§

impl ToCss for TextOverflow

Source§

impl ToCss for lightningcss::properties::position::Position

Source§

impl ToCss for ZIndex

Source§

impl ToCss for BoxSizing

Source§

impl ToCss for MaxSize

Source§

impl ToCss for Size

Source§

impl ToCss for ColorInterpolation

Source§

impl ToCss for ColorRendering

Source§

impl ToCss for ImageRendering

Source§

impl ToCss for SVGPaintFallback

Source§

impl ToCss for ShapeRendering

Source§

impl ToCss for StrokeDasharray

Source§

impl ToCss for StrokeLinecap

Source§

impl ToCss for StrokeLinejoin

Source§

impl ToCss for TextRendering

Source§

impl ToCss for BoxDecorationBreak

Source§

impl ToCss for lightningcss::properties::text::Direction

Source§

impl ToCss for Hyphens

Source§

impl ToCss for LineBreak

Source§

impl ToCss for OverflowWrap

Source§

impl ToCss for Spacing

Source§

impl ToCss for TextAlign

Source§

impl ToCss for TextAlignLast

Source§

impl ToCss for TextDecorationSkipInk

Source§

impl ToCss for TextDecorationStyle

Source§

impl ToCss for TextDecorationThickness

Source§

impl ToCss for TextEmphasisFillMode

Source§

impl ToCss for TextEmphasisPositionHorizontal

Source§

impl ToCss for TextEmphasisPositionVertical

Source§

impl ToCss for TextEmphasisShape

Source§

impl ToCss for TextJustify

Source§

impl ToCss for TextSizeAdjust

Source§

impl ToCss for TextTransformCase

Source§

impl ToCss for UnicodeBidi

Source§

impl ToCss for WhiteSpace

Source§

impl ToCss for WordBreak

Source§

impl ToCss for BackfaceVisibility

Source§

impl ToCss for Perspective

Source§

impl ToCss for Scale

Source§

impl ToCss for Transform

Source§

impl ToCss for TransformBox

Source§

impl ToCss for TransformStyle

Source§

impl ToCss for Translate

Source§

impl ToCss for CaretShape

Source§

impl ToCss for ColorOrAuto

Source§

impl ToCss for CursorKeyword

Source§

impl ToCss for Resize

Source§

impl ToCss for UserSelect

Source§

impl ToCss for ContainerSizeFeatureId

Source§

impl ToCss for lightningcss::rules::font_face::FontStyle

Source§

impl ToCss for FontTechnology

Source§

impl ToCss for BasePalette

Source§

impl ToCss for KeyframeSelector

Source§

impl ToCss for PageMarginBox

Source§

impl ToCss for PagePseudoClass

Source§

impl ToCss for Combinator

Source§

impl ToCss for lightningcss::selector::Direction

Source§

impl ToCss for Angle

Source§

impl ToCss for Constant

Source§

impl ToCss for RoundingStrategy

Source§

impl ToCss for CssColor

Source§

impl ToCss for HueInterpolationMethod

Source§

impl ToCss for SystemColor

Source§

impl ToCss for EasingFunction

Source§

impl ToCss for StepPosition

Source§

impl ToCss for lightningcss::values::gradient::Circle

Source§

impl ToCss for lightningcss::values::gradient::Ellipse

Source§

impl ToCss for EndingShape

Source§

impl ToCss for Gradient

Source§

impl ToCss for ShapeExtent

Source§

impl ToCss for WebKitGradient

Source§

impl ToCss for Length

Source§

impl ToCss for LengthOrNumber

Source§

impl ToCss for LengthPercentageOrAuto

Source§

impl ToCss for LengthValue

Source§

impl ToCss for NumberOrPercentage

Source§

impl ToCss for HorizontalPositionKeyword

Source§

impl ToCss for VerticalPositionKeyword

Source§

impl ToCss for Resolution

Source§

impl ToCss for BasicShape

Source§

impl ToCss for FillRule

Source§

impl ToCss for ShapeRadius

Source§

impl ToCss for SyntaxComponentKind

Source§

impl ToCss for SyntaxString

Source§

impl ToCss for Time

Source§

impl ToCss for Gap

Source§

impl ToCss for PlaceContent

Source§

impl ToCss for PlaceItems

Source§

impl ToCss for PlaceSelf

Source§

impl ToCss for AnimationRange

Source§

impl ToCss for AnimationRangeEnd

Source§

impl ToCss for AnimationRangeStart

Source§

impl ToCss for ScrollTimeline

Source§

impl ToCss for ViewTimeline

Source§

impl ToCss for BackgroundPosition

Source§

impl ToCss for BackgroundRepeat

Source§

impl ToCss for BorderBlockColor

Source§

impl ToCss for BorderBlockStyle

Source§

impl ToCss for BorderBlockWidth

Source§

impl ToCss for BorderColor

Source§

impl ToCss for BorderInlineColor

Source§

impl ToCss for BorderInlineStyle

Source§

impl ToCss for BorderInlineWidth

Source§

impl ToCss for BorderStyle

Source§

impl ToCss for BorderWidth

Source§

impl ToCss for BorderImageRepeat

Source§

impl ToCss for BorderImageSlice

Source§

impl ToCss for BorderRadius

Source§

impl ToCss for BoxShadow

Source§

impl ToCss for Composes<'_>

Source§

impl ToCss for DisplayPair

Source§

impl ToCss for DropShadow

Source§

impl ToCss for Flex

Source§

impl ToCss for FlexFlow

Source§

impl ToCss for Grid<'_>

Source§

impl ToCss for GridArea<'_>

Source§

impl ToCss for GridAutoFlow

Source§

impl ToCss for GridColumn<'_>

Source§

impl ToCss for GridRow<'_>

Source§

impl ToCss for GridTemplate<'_>

Source§

impl ToCss for TrackSizeList

Source§

impl ToCss for Overflow

Source§

impl ToCss for AspectRatio

Source§

impl ToCss for TextDecoration

Source§

impl ToCss for TextDecorationLine

Source§

impl ToCss for TextEmphasisPosition

Source§

impl ToCss for TextIndent

Source§

impl ToCss for TextShadow

Source§

impl ToCss for TextTransform

Source§

impl ToCss for TextTransformOther

Source§

impl ToCss for Rotate

Source§

impl ToCss for TransformList

Source§

impl ToCss for Caret

Source§

impl ToCss for ColorScheme

Source§

impl ToCss for UnicodeRange

Source§

impl ToCss for OverrideColors

Source§

impl ToCss for AlphaValue

Source§

impl ToCss for ConicGradient

Source§

impl ToCss for RadialGradient

Source§

impl ToCss for WebKitColorStop

Source§

impl ToCss for WebKitGradientPoint

Source§

impl ToCss for Percentage

Source§

impl ToCss for lightningcss::values::position::Position

Source§

impl ToCss for Ratio

Source§

impl ToCss for lightningcss::values::shape::Circle

Source§

impl ToCss for lightningcss::values::shape::Ellipse

Source§

impl ToCss for InsetRect

Source§

impl ToCss for Point

Source§

impl ToCss for Polygon

Source§

impl ToCss for SyntaxComponent

Source§

impl ToCss for VendorPrefix

Source§

impl ToCss for CSSInteger

Source§

impl ToCss for CSSNumber

Source§

impl<'a> ToCss for Token<'a>

Source§

impl<'a, 'i> ToCss for Selector<'i>

Source§

impl<'a, 'i> ToCss for SelectorList<'i>

Source§

impl<'a, 'i, T: ToCss> ToCss for CssRule<'i, T>

Source§

impl<'a, 'i, T: ToCss> ToCss for ContainerRule<'i, T>

Source§

impl<'a, 'i, T: ToCss> ToCss for LayerBlockRule<'i, T>

Source§

impl<'a, 'i, T: ToCss> ToCss for MediaRule<'i, T>

Source§

impl<'a, 'i, T: ToCss> ToCss for NestingRule<'i, T>

Source§

impl<'a, 'i, T: ToCss> ToCss for CssRuleList<'i, T>

Source§

impl<'a, 'i, T: ToCss> ToCss for StyleRule<'i, T>

Source§

impl<'a, 'i, T: ToCss> ToCss for SupportsRule<'i, T>

Source§

impl<'i> ToCss for MediaCondition<'i>

Source§

impl<'i> ToCss for MediaFeatureValue<'i>

Source§

impl<'i> ToCss for AnimationName<'i>

Source§

impl<'i> ToCss for AnimationTimeline<'i>

Source§

impl<'i> ToCss for ContainerNameList<'i>

Source§

impl<'i> ToCss for Specifier<'i>

Source§

impl<'i> ToCss for CustomPropertyName<'i>

Source§

impl<'i> ToCss for EnvironmentVariableName<'i>

Source§

impl<'i> ToCss for Filter<'i>

Source§

impl<'i> ToCss for FilterList<'i>

Source§

impl<'i> ToCss for PropertyId<'i>

Source§

impl<'i> ToCss for FontFamily<'i>

Source§

impl<'i> ToCss for TrackSizing<'i>

Source§

impl<'i> ToCss for ListStyleType<'i>

Source§

impl<'i> ToCss for Symbol<'i>

Source§

impl<'i> ToCss for ClipPath<'i>

Source§

impl<'i> ToCss for Marker<'i>

Source§

impl<'i> ToCss for SVGPaint<'i>

Source§

impl<'i> ToCss for TextEmphasisStyle<'i>

Source§

impl<'i> ToCss for Appearance<'i>

Source§

impl<'i> ToCss for ContainerCondition<'i>

Source§

impl<'i> ToCss for StyleQuery<'i>

Source§

impl<'i> ToCss for FontFaceProperty<'i>

Source§

impl<'i> ToCss for FontFormat<'i>

Source§

impl<'i> ToCss for Source<'i>

Source§

impl<'i> ToCss for FontPaletteValuesProperty<'i>

Source§

impl<'i> ToCss for KeyframesName<'i>

Source§

impl<'i> ToCss for SupportsCondition<'i>

Source§

impl<'i> ToCss for ViewTransitionPartName<'i>

Source§

impl<'i> ToCss for Image<'i>

Source§

impl<'i> ToCss for ParsedComponent<'i>

Source§

impl<'i> ToCss for DeclarationBlock<'i>

Source§

impl<'i> ToCss for MediaList<'i>

Source§

impl<'i> ToCss for MediaQuery<'i>

Source§

impl<'i> ToCss for Animation<'i>

Source§

impl<'i> ToCss for Background<'i>

Source§

impl<'i> ToCss for BorderImage<'i>

Source§

impl<'i> ToCss for Container<'i>

Source§

impl<'i> ToCss for Font<'i>

Source§

impl<'i> ToCss for TrackList<'i>

Source§

impl<'i> ToCss for TrackRepeat<'i>

Source§

impl<'i> ToCss for ListStyle<'i>

Source§

impl<'i> ToCss for Mask<'i>

Source§

impl<'i> ToCss for MaskBorder<'i>

Source§

impl<'i> ToCss for TextEmphasis<'i>

Source§

impl<'i> ToCss for Transition<'i>

Source§

impl<'i> ToCss for Cursor<'i>

Source§

impl<'i> ToCss for CursorImage<'i>

Source§

impl<'i> ToCss for ContainerName<'i>

Source§

impl<'i> ToCss for CounterStyleRule<'i>

Source§

impl<'i> ToCss for CustomMediaRule<'i>

Source§

impl<'i> ToCss for FontFaceRule<'i>

Source§

impl<'i> ToCss for UrlSource<'i>

Source§

impl<'i> ToCss for FontPaletteValuesRule<'i>

Source§

impl<'i> ToCss for ImportRule<'i>

Source§

impl<'i> ToCss for Keyframe<'i>

Source§

impl<'i> ToCss for KeyframesRule<'i>

Source§

impl<'i> ToCss for LayerName<'i>

Source§

impl<'i> ToCss for LayerStatementRule<'i>

Source§

impl<'i> ToCss for NamespaceRule<'i>

Source§

impl<'i> ToCss for PageMarginRule<'i>

Source§

impl<'i> ToCss for PageRule<'i>

Source§

impl<'i> ToCss for PageSelector<'i>

Source§

impl<'i> ToCss for PropertyRule<'i>

Source§

impl<'i> ToCss for UnknownAtRule<'i>

Source§

impl<'i> ToCss for ViewportRule<'i>

Source§

impl<'i> ToCss for CustomIdent<'i>

Source§

impl<'i> ToCss for DashedIdent<'i>

Source§

impl<'i> ToCss for DashedIdentReference<'i>

Source§

impl<'i> ToCss for Ident<'i>

Source§

impl<'i> ToCss for ImageSet<'i>

Source§

impl<'i> ToCss for CSSString<'i>

Source§

impl<'i> ToCss for Url<'i>

Source§

impl<'i, FeatureId: FeatureToCss> ToCss for MediaFeatureName<'i, FeatureId>

Source§

impl<'i, FeatureId: FeatureToCss> ToCss for QueryFeature<'i, FeatureId>

Source§

impl<'i, T: ToCss> ToCss for MozDocumentRule<'i, T>

Source§

impl<'i, T: ToCss> ToCss for ScopeRule<'i, T>

Source§

impl<'i, T: ToCss> ToCss for StartingStyleRule<'i, T>

Source§

impl<D: ToCss + Mul<CSSNumber, Output = D> + TrySign + Clone + Debug> ToCss for DimensionPercentage<D>

Source§

impl<D: ToCss> ToCss for GradientItem<D>

Source§

impl<D: ToCss> ToCss for ColorStop<D>

Source§

impl<S: ToCss + Clone + Into<LengthPercentage>> ToCss for WebKitGradientPointComponent<S>

Source§

impl<S: ToCss + Default + PartialEq, const P: u8> ToCss for GenericBorder<S, P>

Source§

impl<S: ToCss> ToCss for PositionComponent<S>

Source§

impl<T> ToCss for Rect<T>
where T: PartialEq + ToCss,

Source§

impl<T> ToCss for Size2D<T>
where T: ToCss + PartialEq,

Source§

impl<V: ToCss + Mul<f32, Output = V> + TrySign + Clone + Debug> ToCss for Calc<V>

Source§

impl<V: ToCss + Mul<f32, Output = V> + TrySign + Clone + Debug> ToCss for MathFunction<V>