pub enum Align {
Start,
Center,
End,
Stretch,
Baseline,
}Expand description
How children are aligned on the cross axis.
Variants§
Start
Packed at the near edge of the cross axis.
Center
Packed at the middle.
End
Packed at the far edge of the cross axis.
Stretch
Children stretch to fill the cross axis. This is the default.
Baseline
Children are aligned on their text baselines: the line their letters sit on, rather than their tops, their middles or their bottoms.
It is the only alignment that makes two runs of different sizes look like one line — a price beside its currency, a heading beside a note. Nothing here resolves it: the layer above measures each child’s baseline and turns the difference into a top margin, so by the time taffy sees it the children are already where they belong and it aligns them to the start.
Trait Implementations§
impl Copy for Align
impl StructuralPartialEq for Align
Auto Trait Implementations§
impl Freeze for Align
impl RefUnwindSafe for Align
impl Send for Align
impl Sync for Align
impl Unpin for Align
impl UnsafeUnpin for Align
impl UnwindSafe for Align
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