Expand description
Const-compatible Rust source code generation from parsed CSS. Generates const-compatible Rust source code from parsed CSS values.
This module provides the [FormatAsRustCode] trait for converting CSS types
into Rust source strings, [GetHash] for content-based deduplication, and
[VecContents] for collecting heap-allocated CSS values that must be
declared as const slices before use in generated code.
Primary consumer: core::xml uses this for CSS-to-Rust code generation.
Structs§
- VecContents
- Collects heap-allocated CSS values (strings, vecs) that must be emitted as
constslice declarations before the generated Rust code can reference them.
Traits§
- Format
AsRust Code - Formats a value as const-compatible Rust source code.
- GetHash
- Returns a deterministic 64-bit hash for content-based deduplication.
Functions§
- format_
angle_ value - Formats an
AngleValueas a const-compatible Rust constructor call. - format_
color_ value - Formats a
ColorUas a const-compatible Rust struct literal. - format_
float_ value - Formats a
FloatValueas a const-compatible Rust constructor call. - format_
percentage_ value - Formats a
PercentageValueas a const-compatible Rust constructor call. - format_
pixel_ value - Formats a
PixelValueas a const-compatible Rust constructor call. - format_
pixel_ value_ no_ percent - Formats a
PixelValueNoPercentas a const-compatible Rust constructor call. - format_
scrollbar_ info - Formats a
ScrollbarInfoas a const-compatible Rust struct literal.