pub enum StretchAxis {
None,
Horizontal,
Vertical,
Both,
MainAxis,
CrossAxis,
}Expand description
Specifies which axis (or axes) a view wants to stretch to fill available space.
Variants§
None
No stretching - view uses its intrinsic size
Horizontal
Stretch horizontally only (expand width, use intrinsic height)
Vertical
Stretch vertically only (expand height, use intrinsic width)
Both
Stretch in both directions (expand width and height)
MainAxis
Stretch along the parent container’s main axis.
In VStack: expands vertically. In HStack: expands horizontally.
Used by Spacer.
CrossAxis
Stretch along the parent container’s cross axis.
In VStack: expands horizontally. In HStack: expands vertically.
Used by Divider.
Implementations§
Source§impl StretchAxis
impl StretchAxis
Sourcepub const fn stretches_horizontal(&self) -> bool
pub const fn stretches_horizontal(&self) -> bool
Returns true if this stretches horizontally.
Sourcepub const fn stretches_vertical(&self) -> bool
pub const fn stretches_vertical(&self) -> bool
Returns true if this stretches vertically.
Sourcepub const fn stretches_any(&self) -> bool
pub const fn stretches_any(&self) -> bool
Returns true if this stretches in any direction.
Trait Implementations§
Source§impl Clone for StretchAxis
impl Clone for StretchAxis
Source§fn clone(&self) -> StretchAxis
fn clone(&self) -> StretchAxis
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for StretchAxis
impl Debug for StretchAxis
Source§impl Default for StretchAxis
impl Default for StretchAxis
Source§fn default() -> StretchAxis
fn default() -> StretchAxis
Returns the “default value” for a type. Read more
Source§impl PartialEq for StretchAxis
impl PartialEq for StretchAxis
impl Copy for StretchAxis
impl Eq for StretchAxis
impl StructuralPartialEq for StretchAxis
Auto Trait Implementations§
impl Freeze for StretchAxis
impl RefUnwindSafe for StretchAxis
impl Send for StretchAxis
impl Sync for StretchAxis
impl Unpin for StretchAxis
impl UnwindSafe for StretchAxis
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)