Skip to main content

LayoutStyle

Struct LayoutStyle 

Source
pub struct LayoutStyle { /* private fields */ }
Expand description

Compact layout-affecting properties packed into 112 bytes using bit-packed enums, tagged lengths, and f32::NAN sentinels.

Implementations§

Source§

impl LayoutStyle

Packed enum, tagged length, and sentinel offset accessors for LayoutStyle.

Source

pub fn get_display(&self) -> Display

Returns the box Display mode.

§Arguments
  • &Self - Layout style reference.
§Returns
  • Display - Active display mode.
Source

pub fn set_display(&mut self, value: Display) -> &mut Self

Sets the box Display mode.

§Arguments
  • &Self - Mutable layout style.
  • Display - Replacement display mode.
§Returns
  • &mut Self - Mutable layout style for chaining.
Source

pub fn get_position(&self) -> Position

Returns the positioning strategy (Relative, Absolute, Fixed).

§Arguments
  • &Self - Layout style reference.
§Returns
  • Position - Active positioning mode.
Source

pub fn set_position(&mut self, value: Position) -> &mut Self

Sets the positioning strategy.

§Arguments
  • &Self - Mutable layout style.
  • Position - Replacement positioning mode.
§Returns
  • &mut Self - Mutable layout style for chaining.
Source

pub fn get_flex_direction(&self) -> FlexDirection

Returns the flex main-axis direction.

§Arguments
  • &Self - Layout style reference.
§Returns
  • FlexDirection - Active flex direction.
Source

pub fn set_flex_direction(&mut self, value: FlexDirection) -> &mut Self

Sets the flex main-axis direction.

§Arguments
  • &Self - Mutable layout style.
  • FlexDirection - Replacement flex direction.
§Returns
  • &mut Self - Mutable layout style for chaining.
Source

pub fn get_flex_wrap(&self) -> FlexWrap

Returns the flex wrapping mode.

§Arguments
  • &Self - Layout style reference.
§Returns
  • FlexWrap - Active flex wrap mode.
Source

pub fn set_flex_wrap(&mut self, value: FlexWrap) -> &mut Self

Sets the flex wrapping mode.

§Arguments
  • &Self - Mutable layout style.
  • FlexWrap - Replacement flex wrap mode.
§Returns
  • &mut Self - Mutable layout style for chaining.
Source

pub fn get_justify_content(&self) -> JustifyContent

Returns main-axis content justification.

§Arguments
  • &Self - Layout style reference.
§Returns
  • JustifyContent - Active justification mode.
Source

pub fn set_justify_content(&mut self, value: JustifyContent) -> &mut Self

Sets main-axis content justification.

§Arguments
  • &Self - Mutable layout style.
  • JustifyContent - Replacement justification mode.
§Returns
  • &mut Self - Mutable layout style for chaining.
Source

pub fn get_align_items(&self) -> AlignItems

Returns cross-axis alignment for children.

§Arguments
  • &Self - Layout style reference.
§Returns
  • AlignItems - Active cross-axis alignment.
Source

pub fn set_align_items(&mut self, value: AlignItems) -> &mut Self

Sets cross-axis alignment for children.

§Arguments
  • &Self - Mutable layout style.
  • AlignItems - Replacement cross-axis alignment.
§Returns
  • &mut Self - Mutable layout style for chaining.
Source

pub fn get_align_self(&self) -> AlignSelf

Returns per-item cross-axis alignment override.

§Arguments
  • &Self - Layout style reference.
§Returns
  • AlignSelf - Active self-alignment override.
Source

pub fn set_align_self(&mut self, value: AlignSelf) -> &mut Self

Sets per-item cross-axis alignment override.

§Arguments
  • &Self - Mutable layout style.
  • AlignSelf - Replacement self-alignment override.
§Returns
  • &mut Self - Mutable layout style for chaining.
Source

pub fn get_overflow(&self) -> Overflow

Returns overflow clipping and scrolling behavior.

§Arguments
  • &Self - Layout style reference.
§Returns
  • Overflow - Active overflow policy.
Source

pub fn set_overflow(&mut self, value: Overflow) -> &mut Self

Sets overflow clipping and scrolling behavior.

§Arguments
  • &Self - Mutable layout style.
  • Overflow - Replacement overflow policy.
§Returns
  • &mut Self - Mutable layout style for chaining.
Source

pub fn get_flex_basis(&self) -> Length

Returns the flex basis length.

§Arguments
  • &Self - Layout style reference.
§Returns
  • Length - Flex basis length.
Source

pub fn set_flex_basis(&mut self, value: Length) -> &mut Self

Sets the flex basis length.

§Arguments
  • &Self - Mutable layout style.
  • Length - Replacement flex basis.
§Returns
  • &mut Self - Mutable layout style for chaining.
Source

pub fn get_width(&self) -> Length

Returns the width length specification.

§Arguments
  • &Self - Layout style reference.
§Returns
  • Length - Width specification.
Source

pub fn set_width(&mut self, value: Length) -> &mut Self

Sets the width length specification.

§Arguments
  • &Self - Mutable layout style.
  • Length - Replacement width.
§Returns
  • &mut Self - Mutable layout style for chaining.
Source

pub fn get_height(&self) -> Length

Returns the height length specification.

§Arguments
  • &Self - Layout style reference.
§Returns
  • Length - Height specification.
Source

pub fn set_height(&mut self, value: Length) -> &mut Self

Sets the height length specification.

§Arguments
  • &Self - Mutable layout style.
  • Length - Replacement height.
§Returns
  • &mut Self - Mutable layout style for chaining.
Source

pub fn get_min_width(&self) -> Length

Returns the minimum width constraint.

§Arguments
  • &Self - Layout style reference.
§Returns
  • Length - Minimum width constraint.
Source

pub fn set_min_width(&mut self, value: Length) -> &mut Self

Sets the minimum width constraint.

§Arguments
  • &Self - Mutable layout style.
  • Length - Replacement minimum width.
§Returns
  • &mut Self - Mutable layout style for chaining.
Source

pub fn get_min_height(&self) -> Length

Returns the minimum height constraint.

§Arguments
  • &Self - Layout style reference.
§Returns
  • Length - Minimum height constraint.
Source

pub fn set_min_height(&mut self, value: Length) -> &mut Self

Sets the minimum height constraint.

§Arguments
  • &Self - Mutable layout style.
  • Length - Replacement minimum height.
§Returns
  • &mut Self - Mutable layout style for chaining.
Source

pub fn get_max_width(&self) -> Length

Returns the maximum width constraint.

§Arguments
  • &Self - Layout style reference.
§Returns
  • Length - Maximum width constraint.
Source

pub fn set_max_width(&mut self, value: Length) -> &mut Self

Sets the maximum width constraint.

§Arguments
  • &Self - Mutable layout style.
  • Length - Replacement maximum width.
§Returns
  • &mut Self - Mutable layout style for chaining.
Source

pub fn get_max_height(&self) -> Length

Returns the maximum height constraint.

§Arguments
  • &Self - Layout style reference.
§Returns
  • Length - Maximum height constraint.
Source

pub fn set_max_height(&mut self, value: Length) -> &mut Self

Sets the maximum height constraint.

§Arguments
  • &Self - Mutable layout style.
  • Length - Replacement maximum height.
§Returns
  • &mut Self - Mutable layout style for chaining.
Source

pub fn top_offset(&self) -> Option<f32>

Returns the optional top offset.

§Arguments
  • &Self - Layout style.
§Returns
  • Option<f32> - Top offset if specified.
Source

pub fn set_top(&mut self, value: Option<f32>) -> &mut Self

Sets the optional top offset.

§Arguments
  • &Self - Mutable layout style.
  • Option<f32> - Top offset or None to clear.
§Returns
  • &mut Self - Mutable layout style for chaining.
Source

pub fn right_offset(&self) -> Option<f32>

Returns the optional right offset.

§Arguments
  • &Self - Layout style.
§Returns
  • Option<f32> - Right offset if specified.
Source

pub fn set_right(&mut self, value: Option<f32>) -> &mut Self

Sets the optional right offset.

§Arguments
  • &Self - Mutable layout style.
  • Option<f32> - Right offset or None to clear.
§Returns
  • &mut Self - Mutable layout style for chaining.
Source

pub fn bottom_offset(&self) -> Option<f32>

Returns the optional bottom offset.

§Arguments
  • &Self - Layout style.
§Returns
  • Option<f32> - Bottom offset if specified.
Source

pub fn set_bottom(&mut self, value: Option<f32>) -> &mut Self

Sets the optional bottom offset.

§Arguments
  • &Self - Mutable layout style.
  • Option<f32> - Bottom offset or None to clear.
§Returns
  • &mut Self - Mutable layout style for chaining.
Source

pub fn left_offset(&self) -> Option<f32>

Returns the optional left offset.

§Arguments
  • &Self - Layout style.
§Returns
  • Option<f32> - Left offset if specified.
Source

pub fn set_left(&mut self, value: Option<f32>) -> &mut Self

Sets the optional left offset.

§Arguments
  • &Self - Mutable layout style.
  • Option<f32> - Left offset or None to clear.
§Returns
  • &mut Self - Mutable layout style for chaining.
Source

pub fn aspect_ratio_value(&self) -> Option<f32>

Returns the optional aspect ratio (width / height).

§Arguments
  • &Self - Layout style.
§Returns
  • Option<f32> - Aspect ratio if specified.
Source

pub fn set_aspect_ratio(&mut self, value: Option<f32>) -> &mut Self

Sets the optional aspect ratio (width / height).

§Arguments
  • &Self - Mutable layout style.
  • Option<f32> - Positive aspect ratio or None to clear.
§Returns
  • &mut Self - Mutable layout style for chaining.
Source§

impl LayoutStyle

Source

pub fn get_flex_grow(&self) -> f32

Source

pub fn get_mut_flex_grow(&mut self) -> &mut f32

Source

pub fn set_flex_grow(&mut self, val: f32) -> &mut Self

Source

pub fn get_flex_shrink(&self) -> f32

Source

pub fn get_mut_flex_shrink(&mut self) -> &mut f32

Source

pub fn set_flex_shrink(&mut self, val: f32) -> &mut Self

Source

pub fn get_margin(&self) -> Edges

Source

pub fn get_mut_margin(&mut self) -> &mut Edges

Source

pub fn set_margin(&mut self, val: Edges) -> &mut Self

Source

pub fn get_padding(&self) -> Edges

Source

pub fn get_mut_padding(&mut self) -> &mut Edges

Source

pub fn set_padding(&mut self, val: Edges) -> &mut Self

Source

pub fn get_row_gap(&self) -> f32

Source

pub fn get_mut_row_gap(&mut self) -> &mut f32

Source

pub fn set_row_gap(&mut self, val: f32) -> &mut Self

Source

pub fn get_column_gap(&self) -> f32

Source

pub fn get_mut_column_gap(&mut self) -> &mut f32

Source

pub fn set_column_gap(&mut self, val: f32) -> &mut Self

Source

pub fn get_z_index(&self) -> i32

Source

pub fn get_mut_z_index(&mut self) -> &mut i32

Source

pub fn set_z_index(&mut self, val: i32) -> &mut Self

Source

pub fn get_grid_columns(&self) -> u16

Source

pub fn get_mut_grid_columns(&mut self) -> &mut u16

Source

pub fn set_grid_columns(&mut self, val: u16) -> &mut Self

Trait Implementations§

Source§

impl Clone for LayoutStyle

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for LayoutStyle

Source§

impl Debug for LayoutStyle

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for LayoutStyle

Default layout style matching standard Flexbox defaults.

Source§

fn default() -> Self

Creates default layout properties (Flex, Row, flex_shrink: 1.0).

§Returns
  • Self - Default LayoutStyle.
Source§

impl PartialEq for LayoutStyle

Sentinel-aware value equality for compact LayoutStyle.

Source§

fn eq(&self, other: &Self) -> bool

Compares two LayoutStyle values treating matching f32::NAN sentinels as equal None options.

§Arguments
  • &Self - Left-hand layout style.
  • &Self - Right-hand layout style.
§Returns
  • bool - true when all layout properties match identically.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.