pub trait Unit:
Sized
+ ToCss
+ Default
+ CssNumberNewType<Self::Number> {
type Number: CssNumber;
const HasDimension: bool;
// Required methods
fn parse_one_outside_calc_function<'i, 't>(
context: &ParserContext,
input: &mut Parser<'i, 't>,
) -> Result<CalculablePropertyValue<Self>, ParseError<'i, CustomParseError<'i>>>;
fn parse_one_inside_calc_function<'i, 't>(
context: &ParserContext,
input: &mut Parser<'i, 't>,
) -> Result<Either<CalculablePropertyValue<Self>, CalcExpression<Self>>, ParseError<'i, CustomParseError<'i>>>;
fn to_canonical_dimension_value<Conversion: FontRelativeLengthConversion<Self::Number> + ViewportPercentageLengthConversion<Self::Number> + PercentageConversion<Self::Number>>(
&self,
conversion: &Conversion,
) -> Self::Number;
fn from_raw_css_for_var_expression_evaluation(
value: &str,
is_not_in_page_rule: bool,
) -> Option<Self>;
// Provided methods
fn to_canonical_dimension(self) -> Self { ... }
fn number_inside_calc_function<'i>(
value: f32,
) -> Result<Either<CalculablePropertyValue<Self>, CalcExpression<Self>>, ParseError<'i, CustomParseError<'i>>> { ... }
}
Required Associated Constants§
const HasDimension: bool
Required Associated Types§
Required Methods§
fn parse_one_outside_calc_function<'i, 't>( context: &ParserContext, input: &mut Parser<'i, 't>, ) -> Result<CalculablePropertyValue<Self>, ParseError<'i, CustomParseError<'i>>>
fn parse_one_inside_calc_function<'i, 't>( context: &ParserContext, input: &mut Parser<'i, 't>, ) -> Result<Either<CalculablePropertyValue<Self>, CalcExpression<Self>>, ParseError<'i, CustomParseError<'i>>>
fn to_canonical_dimension_value<Conversion: FontRelativeLengthConversion<Self::Number> + ViewportPercentageLengthConversion<Self::Number> + PercentageConversion<Self::Number>>( &self, conversion: &Conversion, ) -> Self::Number
fn from_raw_css_for_var_expression_evaluation( value: &str, is_not_in_page_rule: bool, ) -> Option<Self>
Provided Methods§
fn to_canonical_dimension(self) -> Self
fn number_inside_calc_function<'i>( value: f32, ) -> Result<Either<CalculablePropertyValue<Self>, CalcExpression<Self>>, ParseError<'i, CustomParseError<'i>>>
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.