pub struct LinearLayout {
pub axis: Axis,
pub gap: u16,
pub padding: EdgeInsets,
pub cross_align: Align,
}Fields§
§axis: Axis§gap: u16§padding: EdgeInsets§cross_align: AlignImplementations§
Source§impl LinearLayout
impl LinearLayout
pub const fn column() -> Self
pub const fn row() -> Self
pub const fn flex_row() -> Self
pub const fn flex_column() -> Self
pub const fn with_gap(self, gap: u16) -> Self
pub const fn with_padding(self, padding: EdgeInsets) -> Self
pub fn arrange(&self, area: Rect, item_count: usize, out: &mut [Rect]) -> usize
Source§impl LinearLayout
impl LinearLayout
Sourcepub fn arrange_items(
&self,
area: Rect,
items: &[LayoutItem],
out: &mut [Rect],
) -> usize
pub fn arrange_items( &self, area: Rect, items: &[LayoutItem], out: &mut [Rect], ) -> usize
Arranges items in a deterministic single pass.
Fixed, percentage, ratio, min, and max requests are assigned before fill space. If those requests exceed the available main-axis space, items keep their requested sizes and later items may extend beyond the layout area; render-time clipping is responsible for trimming pixels. Weighted fill receives remaining pixels, with any rounding remainder assigned to the final fill item.
pub fn arrange_items_flex( &self, area: Rect, items: &[LayoutItem], out: &mut [Rect], enable_grow: bool, enable_shrink: bool, ) -> usize
Trait Implementations§
Source§impl Clone for LinearLayout
impl Clone for LinearLayout
Source§fn clone(&self) -> LinearLayout
fn clone(&self) -> LinearLayout
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for LinearLayout
Source§impl Debug for LinearLayout
impl Debug for LinearLayout
impl Eq for LinearLayout
Source§impl PartialEq for LinearLayout
impl PartialEq for LinearLayout
Source§fn eq(&self, other: &LinearLayout) -> bool
fn eq(&self, other: &LinearLayout) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for LinearLayout
Auto Trait Implementations§
impl Freeze for LinearLayout
impl RefUnwindSafe for LinearLayout
impl Send for LinearLayout
impl Sync for LinearLayout
impl Unpin for LinearLayout
impl UnsafeUnpin for LinearLayout
impl UnwindSafe for LinearLayout
Blanket Implementations§
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
Mutably borrows from an owned value. Read more
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Casts the value.
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Casts the value.
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> OverflowingAs for T
impl<T> OverflowingAs for T
Source§fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
Source§fn overflowing_cast_from(src: Src) -> (Dst, bool)
fn overflowing_cast_from(src: Src) -> (Dst, bool)
Casts the value.
Source§impl<T> SaturatingAs for T
impl<T> SaturatingAs for T
Source§fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
Source§fn saturating_cast_from(src: Src) -> Dst
fn saturating_cast_from(src: Src) -> Dst
Casts the value.
Source§impl<T> UnwrappedAs for T
impl<T> UnwrappedAs for T
Source§fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
Casts the value.
Source§impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
Source§fn unwrapped_cast_from(src: Src) -> Dst
fn unwrapped_cast_from(src: Src) -> Dst
Casts the value.
Source§impl<T> WrappingAs for T
impl<T> WrappingAs for T
Source§fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
Source§fn wrapping_cast_from(src: Src) -> Dst
fn wrapping_cast_from(src: Src) -> Dst
Casts the value.