pub struct GridLength { /* private fields */ }Expand description
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.
Implementations§
Source§impl GridLength
impl GridLength
Sourcepub const AUTO: GridLength
pub const AUTO: GridLength
A length that indicates that a row or column should auto-size to fit its content.
Sourcepub const STAR: GridLength
pub const STAR: GridLength
A length that indicates that a row or column should fill its content.
Sourcepub fn from_pixels(value: f64) -> Self
pub fn from_pixels(value: f64) -> Self
Creates a length in device independent pixels.
Panics if the value is negative, NaN or infinite.
Sourcepub fn new(value: f64, type_: GridUnitType) -> Self
pub fn new(value: f64, type_: GridUnitType) -> Self
Creates a length with the given unit.
Panics if the value is negative, NaN or infinite.
Sourcepub const fn auto() -> Self
pub const fn auto() -> Self
A length that indicates that a row or column should auto-size to fit its content.
Sourcepub const fn star() -> Self
pub const fn star() -> Self
A length that indicates that a row or column should fill its content.
Sourcepub const fn grid_unit_type(&self) -> GridUnitType
pub const fn grid_unit_type(&self) -> GridUnitType
The unit of the length.
Sourcepub fn is_absolute(&self) -> bool
pub fn is_absolute(&self) -> bool
Whether the length has a GridUnitType of Pixel.
Sourcepub fn is_auto(&self) -> bool
pub fn is_auto(&self) -> bool
Whether the length has a GridUnitType of Auto.
Sourcepub fn is_star(&self) -> bool
pub fn is_star(&self) -> bool
Whether the length has a GridUnitType of Star.
Sourcepub fn parse(s: &str) -> Result<GridLength, FormatError>
pub fn parse(s: &str) -> Result<GridLength, FormatError>
Parses a string to return a GridLength.
Sourcepub fn parse_lengths(s: &str) -> Result<Vec<GridLength>, FormatError>
pub fn parse_lengths(s: &str) -> Result<Vec<GridLength>, FormatError>
Parses a string to return a collection of GridLengths.
Trait Implementations§
Source§impl Clone for GridLength
impl Clone for GridLength
impl Copy for GridLength
Source§impl Debug for GridLength
impl Debug for GridLength
Source§impl Default for GridLength
impl Default for GridLength
Source§impl Display for GridLength
impl Display for GridLength
Source§impl FromStr for GridLength
impl FromStr for GridLength
Source§impl Hash for GridLength
impl Hash for GridLength
Source§impl MarkupTyped for GridLength
impl MarkupTyped for GridLength
Source§const MARKUP: &'static MarkupType
const MARKUP: &'static MarkupType
Auto Trait Implementations§
impl Freeze for GridLength
impl RefUnwindSafe for GridLength
impl Send for GridLength
impl Sync for GridLength
impl Unpin for GridLength
impl UnsafeUnpin for GridLength
impl UnwindSafe for GridLength
Blanket Implementations§
Source§impl<T> AnyValue for Twhere
T: PartialEq + 'static,
impl<T> AnyValue for Twhere
T: PartialEq + 'static,
fn any_value_as_any(&self) -> &(dyn Any + 'static)
fn any_value_eq(&self, other: &(dyn AnyValue + 'static)) -> bool
fn any_value_type_name(&self) -> &'static str
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
affects_render, metadata
overrides). Read more