pub trait DeclarationMetadata: Sized {
Show 14 methods
// Required method
fn initial() -> &'static str;
// Provided methods
fn inherits() -> Inherits { ... }
fn applies_to() -> AppliesTo { ... }
fn percentages() -> Percentages { ... }
fn animation_type() -> AnimationType { ... }
fn shorthand() -> Option<&'static Shorthand> { ... }
fn longhand() -> Option<&'static Longhand> { ... }
fn property_group() -> PropertyGroup { ... }
fn computed_value_type() -> ComputedValueType { ... }
fn canonical_order() -> Option<&'static str> { ... }
fn logical_property_group() -> Option<CssAtomSet> { ... }
fn box_side() -> BoxSide { ... }
fn box_portion() -> BoxPortion { ... }
fn unitless_zero_resolves() -> UnitlessZeroResolves { ... }
}Required Methods§
Provided Methods§
Sourcefn applies_to() -> AppliesTo
fn applies_to() -> AppliesTo
Determines what types of frames this rule applies to
Sourcefn percentages() -> Percentages
fn percentages() -> Percentages
Determines how this style value resolves percentages, if they are allowed as values
Sourcefn animation_type() -> AnimationType
fn animation_type() -> AnimationType
Returns how this style value animates
Sourcefn shorthand() -> Option<&'static Shorthand>
fn shorthand() -> Option<&'static Shorthand>
Returns what this property does to the properties it covers, or None if it is not a shorthand.
Sourcefn longhand() -> Option<&'static Longhand>
fn longhand() -> Option<&'static Longhand>
Returns what the shorthands which cover this property do to it, or None if no shorthand covers it.
Sourcefn property_group() -> PropertyGroup
fn property_group() -> PropertyGroup
Returns which CSS specification(s) this property belongs to. This allows tracking which CSS modules are used in a stylesheet.
Sourcefn computed_value_type() -> ComputedValueType
fn computed_value_type() -> ComputedValueType
Returns how the computed value is calculated from the specified value.
Sourcefn canonical_order() -> Option<&'static str>
fn canonical_order() -> Option<&'static str>
Returns the canonical order for serialization (e.g., “per grammar”, “unique”). Returns None if not specified or not applicable.
Sourcefn logical_property_group() -> Option<CssAtomSet>
fn logical_property_group() -> Option<CssAtomSet>
Returns the logical property group this property belongs to (e.g., “Margin”, “Border”). This groups related logical/physical properties together. Returns None if this is not part of a logical property group.
Sourcefn box_side() -> BoxSide
fn box_side() -> BoxSide
Returns which side(s) of the box this property applies to.
For example, margin-top returns BoxSide::Top, while margin returns all sides.
Returns BoxSide::none() if the property doesn’t apply to a specific side.
Sourcefn box_portion() -> BoxPortion
fn box_portion() -> BoxPortion
Returns which portion(s) of the box model this property affects.
For example, margin-top returns BoxPortion::Margin, border-width returns BoxPortion::Border.
Returns BoxPortion::none() if the property doesn’t affect the box model.
Sourcefn unitless_zero_resolves() -> UnitlessZeroResolves
fn unitless_zero_resolves() -> UnitlessZeroResolves
Returns how unitless zero resolves for this property.
For properties that accept both <number> and <length>, unitless zero
may resolve to a number rather than a length. This affects whether the
minifier can safely reduce 0px to 0.
Examples where unitless zero resolves to Number (NOT safe to reduce):
line-height: 0means 0x font-size multipliertab-size: 0means 0 tab charactersborder-image-outset: 0means 0x border-width
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".