pub trait ToPercentage {
// Required method
fn to_percentage(&self) -> Option<CSSFloat>;
// Provided method
fn is_calc(&self) -> bool { ... }
}Expand description
Turns the percentage into a plain float.
Required Methods§
Sourcefn to_percentage(&self) -> Option<CSSFloat>
fn to_percentage(&self) -> Option<CSSFloat>
Returns the percentage as a plain float, or None for calc expressions that require
computed context. Will always return Some if is_calc is false.
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".