Thickness
struct · ferroui-base · v0.5.0
struct Thickness
Describes the thickness of a frame around a rectangle.
Members
left
left: f64
The thickness on the left.
top
top: f64
The thickness on the top.
right
right: f64
The thickness on the right.
bottom
bottom: f64
The thickness on the bottom.
new
const fn new(left: f64, top: f64, right: f64, bottom: f64) -> Self
Initializes a new instance of the Thickness structure from the four sides.
uniform
const fn uniform(uniform_length: f64) -> Self
Initializes a Thickness with the same length on every side.
symmetric
const fn symmetric(horizontal: f64, vertical: f64) -> Self
Initializes a Thickness from the thickness on the left and right, and
the thickness on the top and bottom.
is_uniform
fn is_uniform(self: &Self) -> bool
Gets a value indicating whether all sides are equal (NaN compares equal to NaN here).
parse
fn parse(s: &str) -> Result<Self, FormatError>
Parses a Thickness string: one, two or four numbers.
equals
fn equals(self: &Self, other: Thickness) -> bool
Returns a boolean indicating whether the thickness is equal to the other given thickness (exact comparison of the sides).
deconstruct
const fn deconstruct(self: &Self) -> (f64, f64, f64, f64)
Deconstructs the thickness into its left, top, right and bottom values.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafePropertyValueAnyValueClassDefaultsBorrow<T>BorrowMut<T>CloneToUninitInto<U>From<T>TryInto<U>TryFrom<U>AnyToOwnedToStringErasedDestructorIntoEitherTransition<Thickness>MarkupTypedValueTypeRegistrationCloneCopyDebugStructuralPartialEqPartialEqDefaultFrom<Thickness>AddSubMul<f64>Add<Thickness>Sub<Thickness>AddAssignSubAssignMulAssign<f64>AddAssign<Thickness>SubAssign<Thickness>FromStrDisplay
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.