pub trait CssNumber:
Sized
+ Copy
+ Clone
+ PartialEq<Self>
+ Eq
+ PartialOrd
+ Ord
+ Hash
+ ToCss
+ Default
+ Add<Self, Output = Self>
+ AddAssign<Self>
+ Sub<Self, Output = Self>
+ SubAssign<Self>
+ Mul<Self, Output = Self>
+ MulAssign<Self>
+ Div<Self, Output = Self>
+ DivAssign<Self>
+ Rem<Self, Output = Self>
+ RemAssign<Self>
+ Neg<Output = Self>
+ Debug
+ Display
+ Deref
+ From<u16>
+ From<u8>
+ CssNumberNewType<Self>
+ Unit<Number = Self>
+ AppUnitsPer {
const Zero: Self;
const One: Self;
const Maximum: Self;
const Minimum: Self;
const DotsPerInch: Self;
const CentimetresPerInch: Self;
// Required methods
fn as_f32(&self) -> f32;
fn as_u32(&self) -> u32;
fn parseNumber<'i>(
value: f32,
_int_value: Option<i32>,
) -> Result<Self, ParseError<'i, CustomParseError<'i>>>;
// Provided methods
fn new(value: f32) -> Result<Self, CssNumberConversionError> { ... }
fn round(self) -> Self { ... }
fn abs(self) -> Self { ... }
fn clamp(value: f32) -> Self { ... }
fn can_be_negative() -> bool { ... }
}Required Associated Constants§
const Zero: Self
const One: Self
const Maximum: Self
const Minimum: Self
const DotsPerInch: Self
const CentimetresPerInch: Self
Required Methods§
fn as_f32(&self) -> f32
fn as_u32(&self) -> u32
fn parseNumber<'i>( value: f32, _int_value: Option<i32>, ) -> Result<Self, ParseError<'i, CustomParseError<'i>>>
Provided Methods§
fn new(value: f32) -> Result<Self, CssNumberConversionError>
fn round(self) -> Self
fn abs(self) -> Self
fn clamp(value: f32) -> Self
fn can_be_negative() -> bool
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.