FlexBasis
struct · ferroui-controls · v0.5.0
struct FlexBasis
Specifies the initial size of a flex item.
The default value is FlexBasis::AUTO.
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.
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.
absolute
fn absolute(value: f64) -> Self
Creates a basis with the given absolute value.
Panics if the value is negative, NaN or infinite.
value
const fn value(self: &Self) -> f64
The value of the basis. The meaning of this value depends on the
FlexBasisKind.
kind
const fn kind(self: &Self) -> FlexBasisKind
The kind of the basis. This determines how the value affects the size of the flex item.
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.
is_auto
fn is_auto(self: &Self) -> bool
Whether the basis is set to "auto".
is_absolute
fn is_absolute(self: &Self) -> bool
Whether the basis is set to an absolute value.
is_relative
fn is_relative(self: &Self) -> bool
Whether the basis is set to a relative value.
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%).
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeBorrow<T>BorrowMut<T>CloneToUninitInto<U>From<T>TryInto<U>TryFrom<U>AnyToOwnedToStringPropertyValueAnyValueClassDefaultsErasedDestructorIntoEitherCloneCopyDebugDefaultPartialEqHashDisplayFromStr
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.