Struct figures::Size[][src]

pub struct Size<T, Unit> {
    pub width: T,
    pub height: T,
    // some fields omitted
}
Expand description

A measurement of space using width and height.

Fields

width: Theight: T

Implementations

Returns the area represented by this size.

Returns a new vector with width, and T::default() for height.

Returns a new vector with height, and T::default() for width.

Returns a new Size.

Returns a new Size.

Returns the width component.

Returns the height component.

Returns this value with the new unit. Does not affect the underlying value.

Attempts to convert from T to Output using NumCast. Returns None if the value can’t be converted.

Converts from T to Output.

Panics

Panics if Self::try_cast() returns None.

Returns a new instance with the absolute value of each component.

Returns a Vector with the result of signum() called on each component.

Returns a new Size with the smaller value of each component.

Returns a new Size with the larger value of each component.

Trait Implementations

Used for specifying relative comparisons.

The default tolerance to use when testing values that are close together. Read more

A test for equality that uses the absolute difference to compute the approximate equality of two numbers. Read more

The inverse of [AbsDiffEq::abs_diff_eq].

The resulting type after applying the + operator.

Performs the + operation. Read more

The resulting type after applying the + operator.

Performs the + operation. Read more

The resulting type after applying the + operator.

Performs the + operation. Read more

The resulting type after applying the + operator.

Performs the + operation. Read more

Performs the += operation. Read more

Performs the += operation. Read more

Performs the += operation. Read more

Performs the += operation. Read more

Returns true if the values are approximately equal. Uses [approx::AbsDiffEq] with the default epsilon. Read more

Returns true if the values are not approximately equal. Uses [approx::AbsDiffEq] with the default epsilon. Read more

Rounds to the smallest integer equal or greater than the original value. Read more

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Deserialize this value from the given Serde deserializer. Read more

The Pixels unit type for this implementor.

The Points unit type for this implementor.

The Scaled unit type for this implementor.

Returns this value after applying scale, if needed.

Returns this value after applying scale, if needed.

Returns this value after applying scale, if needed.

The Pixels unit type for this implementor.

The Points unit type for this implementor.

The Scaled unit type for this implementor.

Returns this value after applying scale, if needed.

Returns this value after applying scale, if needed.

Returns this value after applying scale, if needed.

The Pixels unit type for this implementor.

The Points unit type for this implementor.

The Scaled unit type for this implementor.

Returns this value after applying scale, if needed.

Returns this value after applying scale, if needed.

Returns this value after applying scale, if needed.

The resulting type after applying the / operator.

Performs the / operation. Read more

The resulting type after applying the / operator.

Performs the / operation. Read more

Rounds to the biggest integer equal or lower than the original value. Read more

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the - operator.

Performs the unary - operation. Read more

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

This method tests for !=.

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

This method tests for !=.

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

This method tests for !=.

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

This method tests for !=.

The default relative tolerance for testing values that are far-apart. Read more

A test for equality that uses a relative comparison if the values are far apart.

The inverse of [RelativeEq::relative_eq].

Rounds to the nearest integer value. Read more

Serialize this value into the given Serde serializer. Read more

The resulting type after applying the - operator.

Performs the - operation. Read more

The resulting type after applying the - operator.

Performs the - operation. Read more

The resulting type after applying the - operator.

Performs the - operation. Read more

The resulting type after applying the - operator.

Performs the - operation. Read more

Performs the -= operation. Read more

Performs the -= operation. Read more

Performs the -= operation. Read more

Performs the -= operation. Read more

The default ULPs to tolerate when testing values that are far-apart. Read more

A test for equality that uses units in the last place (ULP) if the values are far apart.

The inverse of [UlpsEq::ulps_eq].

Returns self as a Vector.

Returns self as a Size.

Returns self as a Point.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.