pub type CalcNode = GenericCalcNode<CalcLengthPercentageLeaf>;
Expand description

The computed version of a calc() node for <length-percentage> values.

Aliased Type§

enum CalcNode {
    Leaf(CalcLengthPercentageLeaf),
    Negate(Box<GenericCalcNode<CalcLengthPercentageLeaf>>),
    Invert(Box<GenericCalcNode<CalcLengthPercentageLeaf>>),
    Sum(OwnedSlice<GenericCalcNode<CalcLengthPercentageLeaf>>),
    Product(OwnedSlice<GenericCalcNode<CalcLengthPercentageLeaf>>),
    MinMax(OwnedSlice<GenericCalcNode<CalcLengthPercentageLeaf>>, MinMaxOp),
    Clamp {
        min: Box<GenericCalcNode<CalcLengthPercentageLeaf>>,
        center: Box<GenericCalcNode<CalcLengthPercentageLeaf>>,
        max: Box<GenericCalcNode<CalcLengthPercentageLeaf>>,
    },
    Round {
        strategy: RoundingStrategy,
        value: Box<GenericCalcNode<CalcLengthPercentageLeaf>>,
        step: Box<GenericCalcNode<CalcLengthPercentageLeaf>>,
    },
    ModRem {
        dividend: Box<GenericCalcNode<CalcLengthPercentageLeaf>>,
        divisor: Box<GenericCalcNode<CalcLengthPercentageLeaf>>,
        op: ModRemOp,
    },
    Hypot(OwnedSlice<GenericCalcNode<CalcLengthPercentageLeaf>>),
    Abs(Box<GenericCalcNode<CalcLengthPercentageLeaf>>),
    Sign(Box<GenericCalcNode<CalcLengthPercentageLeaf>>),
}

Variants§

§

Leaf(CalcLengthPercentageLeaf)

A leaf node.

§

Negate(Box<GenericCalcNode<CalcLengthPercentageLeaf>>)

A node that negates its child, e.g. Negate(1) == -1.

§

Invert(Box<GenericCalcNode<CalcLengthPercentageLeaf>>)

A node that inverts its child, e.g. Invert(10) == 1 / 10 == 0.1. The child must always resolve to a number unit.

§

Sum(OwnedSlice<GenericCalcNode<CalcLengthPercentageLeaf>>)

A sum node, representing a + b + c where a, b, and c are the arguments.

§

Product(OwnedSlice<GenericCalcNode<CalcLengthPercentageLeaf>>)

A product node, representing a * b * c where a, b, and c are the arguments.

§

MinMax(OwnedSlice<GenericCalcNode<CalcLengthPercentageLeaf>>, MinMaxOp)

A min or max function.

§

Clamp

Fields

§center: Box<GenericCalcNode<CalcLengthPercentageLeaf>>

The central value.

A clamp() function.

§

Round

Fields

§strategy: RoundingStrategy

The rounding strategy.

§value: Box<GenericCalcNode<CalcLengthPercentageLeaf>>

The value to round.

A round() function.

§

ModRem

Fields

§dividend: Box<GenericCalcNode<CalcLengthPercentageLeaf>>

The dividend calculation.

§divisor: Box<GenericCalcNode<CalcLengthPercentageLeaf>>

The divisor calculation.

§op: ModRemOp

Is the function mod or rem?

A mod() or rem() function.

§

Hypot(OwnedSlice<GenericCalcNode<CalcLengthPercentageLeaf>>)

A hypot() function

§

Abs(Box<GenericCalcNode<CalcLengthPercentageLeaf>>)

An abs() function.

§

Sign(Box<GenericCalcNode<CalcLengthPercentageLeaf>>)

A sign() function.