FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    Thickness

    struct · ferroui-base · v0.5.0

    struct Thickness
    

    Describes the thickness of a frame around a rectangle.

    View source

    Members

    left

    left: f64
    

    The thickness on the left.

    Source

    top

    top: f64
    

    The thickness on the top.

    Source

    right

    right: f64
    

    The thickness on the right.

    Source

    bottom

    bottom: f64
    

    The thickness on the bottom.

    Source

    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.

    Source

    uniform

    const fn uniform(uniform_length: f64) -> Self
    

    Initializes a Thickness with the same length on every side.

    Source

    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.

    Source

    is_uniform

    fn is_uniform(self: &Self) -> bool
    

    Gets a value indicating whether all sides are equal (NaN compares equal to NaN here).

    Source

    parse

    fn parse(s: &str) -> Result<Self, FormatError>
    

    Parses a Thickness string: one, two or four numbers.

    Source

    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).

    Source

    deconstruct

    const fn deconstruct(self: &Self) -> (f64, f64, f64, f64)
    

    Deconstructs the thickness into its left, top, right and bottom values.

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • PropertyValue
    • AnyValue
    • ClassDefaults
    • Borrow<T>
    • BorrowMut<T>
    • CloneToUninit
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • ToOwned
    • ToString
    • ErasedDestructor
    • IntoEither
    • Transition<Thickness>
    • MarkupTyped
    • ValueTypeRegistration
    • Clone
    • Copy
    • Debug
    • StructuralPartialEq
    • PartialEq
    • Default
    • From<Thickness>
    • Add
    • Sub
    • Mul<f64>
    • Add<Thickness>
    • Sub<Thickness>
    • AddAssign
    • SubAssign
    • MulAssign<f64>
    • AddAssign<Thickness>
    • SubAssign<Thickness>
    • FromStr
    • Display

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.