FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    GridLength

    struct · ferroui-controls · v0.5.0

    struct GridLength
    

    Holds the width or height of a Grid's column and row definitions.

    The default value is an auto-sized length with a value of zero.

    View source

    Members

    AUTO

    const AUTO: GridLength
    

    A length that indicates that a row or column should auto-size to fit its content.

    Source

    STAR

    const STAR: GridLength
    

    A length that indicates that a row or column should fill its content.

    Source

    from_pixels

    fn from_pixels(value: f64) -> Self
    

    Creates a length in device independent pixels.

    Panics if the value is negative, NaN or infinite.

    Source

    new

    fn new(value: f64, type_: GridUnitType) -> Self
    

    Creates a length with the given unit.

    Panics if the value is negative, NaN or infinite.

    Source

    auto

    const fn auto() -> Self
    

    A length that indicates that a row or column should auto-size to fit its content.

    Source

    star

    const fn star() -> Self
    

    A length that indicates that a row or column should fill its content.

    Source

    grid_unit_type

    const fn grid_unit_type(self: &Self) -> GridUnitType
    

    The unit of the length.

    Source

    is_absolute

    fn is_absolute(self: &Self) -> bool
    

    Whether the length has a GridUnitType of Pixel.

    Source

    is_auto

    fn is_auto(self: &Self) -> bool
    

    Whether the length has a GridUnitType of Auto.

    Source

    is_star

    fn is_star(self: &Self) -> bool
    

    Whether the length has a GridUnitType of Star.

    Source

    value

    const fn value(self: &Self) -> f64
    

    The length.

    Source

    parse

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

    Parses a string to return a GridLength.

    Source

    parse_lengths

    fn parse_lengths(s: &str) -> Result<Vec<GridLength>, FormatError>
    

    Parses a string to return a collection of GridLengths.

    Source

    Trait implementations

    Availability

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