FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    FlexBasis

    struct · ferroui-controls · v0.5.0

    struct FlexBasis
    

    Specifies the initial size of a flex item.

    The default value is FlexBasis::AUTO.

    View source

    Members

    AUTO

    const AUTO: FlexBasis
    

    A basis that represents the "auto" value, which means the size of the flex item is determined by its content or other factors.

    Source

    new

    fn new(value: f64, kind: FlexBasisKind) -> Self
    

    Creates a basis with the given value and kind. The kind determines how the value affects the size of the flex item.

    Panics if the value is negative, NaN or infinite.

    Source

    absolute

    fn absolute(value: f64) -> Self
    

    Creates a basis with the given absolute value.

    Panics if the value is negative, NaN or infinite.

    Source

    value

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

    The value of the basis. The meaning of this value depends on the FlexBasisKind.

    Source

    kind

    const fn kind(self: &Self) -> FlexBasisKind
    

    The kind of the basis. This determines how the value affects the size of the flex item.

    Source

    auto

    const fn auto() -> Self
    

    A basis that represents the "auto" value, which means the size of the flex item is determined by its content or other factors.

    Source

    is_auto

    fn is_auto(self: &Self) -> bool
    

    Whether the basis is set to "auto".

    Source

    is_absolute

    fn is_absolute(self: &Self) -> bool
    

    Whether the basis is set to an absolute value.

    Source

    is_relative

    fn is_relative(self: &Self) -> bool
    

    Whether the basis is set to a relative value.

    Source

    parse

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

    Converts a string flex-basis value to a FlexBasis.

    Valid values are auto (in any casing), a number (100) or a percentage (50%).

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • Borrow<T>
    • BorrowMut<T>
    • CloneToUninit
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • ToOwned
    • ToString
    • PropertyValue
    • AnyValue
    • ClassDefaults
    • ErasedDestructor
    • IntoEither
    • Clone
    • Copy
    • Debug
    • Default
    • PartialEq
    • Hash
    • Display
    • FromStr

    Availability

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