Struct style::values::specified::percentage::Percentage [] [src]

pub struct Percentage { /* fields omitted */ }

A percentage value.

Methods

impl Percentage
[src]

[src]

Creates a percentage from a numeric value.

[src]

0%

[src]

100%

[src]

Gets the underlying value for this float.

[src]

Returns whether this percentage is a calc() value.

[src]

Reverses this percentage, preserving calc-ness.

For example: If it was 20%, convert it into 80%.

[src]

Parses a specific kind of percentage.

[src]

Parses a percentage token, but rejects it if it's negative.

[src]

Clamp to 100% if the value is over 100%.

Trait Implementations

impl From<Percentage> for LengthOrPercentage
[src]

[src]

Performs the conversion.

impl Clone for Percentage
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Copy for Percentage
[src]

impl Debug for Percentage
[src]

[src]

Formats the value using the given formatter. Read more

impl Default for Percentage
[src]

[src]

Returns the "default value" for a type. Read more

impl MallocSizeOf for Percentage
[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 Percentage
[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 Percentage
[src]

[src]

Serialize self in CSS syntax, writing to dest.

[src]

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

impl Parse for Percentage
[src]

[src]

Parse a value of this type. Read more

impl ToComputedValue for Percentage
[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