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.
Members
AUTOSTARfrom_pixelsnewautostargrid_unit_typeis_absoluteis_autois_starvalueparseparse_lengths
AUTO
const AUTO: GridLength
A length that indicates that a row or column should auto-size to fit its content.
STAR
const STAR: GridLength
A length that indicates that a row or column should fill its content.
from_pixels
fn from_pixels(value: f64) -> Self
Creates a length in device independent pixels.
Panics if the value is negative, NaN or infinite.
new
fn new(value: f64, type_: GridUnitType) -> Self
Creates a length with the given unit.
Panics if the value is negative, NaN or infinite.
auto
const fn auto() -> Self
A length that indicates that a row or column should auto-size to fit its content.
star
const fn star() -> Self
A length that indicates that a row or column should fill its content.
grid_unit_type
const fn grid_unit_type(self: &Self) -> GridUnitType
The unit of the length.
is_absolute
fn is_absolute(self: &Self) -> bool
Whether the length has a GridUnitType of Pixel.
is_auto
fn is_auto(self: &Self) -> bool
Whether the length has a GridUnitType of Auto.
is_star
fn is_star(self: &Self) -> bool
Whether the length has a GridUnitType of Star.
value
const fn value(self: &Self) -> f64
The length.
parse
fn parse(s: &str) -> Result<GridLength, FormatError>
Parses a string to return a GridLength.
parse_lengths
fn parse_lengths(s: &str) -> Result<Vec<GridLength>, FormatError>
Parses a string to return a collection of GridLengths.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeBorrow<T>BorrowMut<T>CloneToUninitInto<U>From<T>TryInto<U>TryFrom<U>AnyToOwnedToStringPropertyValueAnyValueClassDefaultsErasedDestructorIntoEitherCloneCopyDebugDefaultPartialEqHashDisplayFromStrMarkupTypedValueTypeRegistration
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.