Enum style::values::specified::length::Length [] [src]

pub enum Length {
    NoCalc(NoCalcLength),
    Calc(Box<CalcLengthOrPercentage>),
}

An extension to NoCalcLength to parse calc expressions. This is commonly used for the <length> values.

https://drafts.csswg.org/css-values/#lengths

Variants

The internal length type that cannot parse calc

A calc expression.

https://drafts.csswg.org/css-values/#calc-notation

Methods

impl Length
[src]

[src]

Returns a zero length.

[src]

Parse a given absolute or relative dimension.

[src]

Parse a non-negative length

[src]

Parse a non-negative length, allowing quirks.

[src]

Get an absolute length from a px value.

[src]

Extract inner length without a clone, replacing it with a 0 Au

Use when you need to move out of a length array without cloning

impl Length
[src]

[src]

Parses a length, with quirks.

Trait Implementations

impl ToComputedValue for Length
[src]

The computed value type we're going to be converted to.

[src]

Convert a specified value to a computed value, using itself and the data inside the Context. Read more

[src]

Convert a computed value to specified value form. Read more

impl ToAbsoluteLength for SpecifiedLength
[src]

[src]

Returns the absolute length as pixel value.

impl Clone for Length
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for Length
[src]

[src]

Formats the value using the given formatter. Read more

impl MallocSizeOf for Length
[src]

[src]

Measure the heap usage of all descendant heap-allocated structures, but not the space taken up by the value itself. Read more

impl PartialEq for Length
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

[src]

This method tests for !=.

impl ToCss for Length
[src]

[src]

Serialize self in CSS syntax, writing to dest.

[src]

Serialize self in CSS syntax and return a string. Read more

impl From<NoCalcLength> for Length
[src]

[src]

Performs the conversion.

impl Mul<CSSFloat> for Length
[src]

The resulting type after applying the * operator.

[src]

Performs the * operation.

impl Parse for Length
[src]

[src]

Parse a value of this type. Read more

impl From<Length> for NonNegativeLength
[src]

[src]

Performs the conversion.

impl From<Length> for LengthOrPercentage
[src]

[src]

Performs the conversion.