Type Alias style::values::specified::length::NonNegativeLength

source ·
pub type NonNegativeLength = NonNegative<Length>;
Expand description

A wrapper of Length, whose value must be >= 0.

Aliased Type§

struct NonNegativeLength(pub Length);

Fields§

§0: Length

Implementations§

source§

impl NonNegativeLength

source

pub fn from_px(px_value: CSSFloat) -> Self

Get an absolute length from a px value.

source

pub fn parse_quirky<'i, 't>( context: &ParserContext<'_>, input: &mut Parser<'i, 't>, allow_quirks: AllowQuirks, ) -> Result<Self, ParseError<'i>>

Parses a non-negative length, optionally with quirks.

Trait Implementations§

source§

impl From<Length> for NonNegativeLength

source§

fn from(len: Length) -> Self

Converts to this type from the input type.
source§

impl From<NoCalcLength> for NonNegativeLength

source§

fn from(len: NoCalcLength) -> Self

Converts to this type from the input type.
source§

impl Parse for NonNegativeLength

source§

fn parse<'i, 't>( context: &ParserContext<'_>, input: &mut Parser<'i, 't>, ) -> Result<Self, ParseError<'i>>

Parse a value of this type. Read more