pub enum TextAlign {
Left,
Center,
Right,
}Expand description
Horizontal alignment of the lines of a RichText inside its block.
The block is as wide as its widest line, and placement code positions that block; alignment only decides where each shorter line spends its slack (the block width minus its own width): none of it before the line, half, or all. The block’s measured envelope is therefore the same for every alignment, so selection and hit boxes need no change, and single-line text (no slack) is unaffected. Tab-column cells move with their line.
Variants§
Left
Every line starts at the block’s left edge — the layout all text had before alignment existed.
Center
Each line is centred on the block.
Right
Every line ends at the block’s right edge.
Implementations§
Trait Implementations§
impl Copy for TextAlign
Source§impl<'de> Deserialize<'de> for TextAlign
impl<'de> Deserialize<'de> for TextAlign
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for TextAlign
impl StructuralPartialEq for TextAlign
Auto Trait Implementations§
impl Freeze for TextAlign
impl RefUnwindSafe for TextAlign
impl Send for TextAlign
impl Sync for TextAlign
impl Unpin for TextAlign
impl UnsafeUnpin for TextAlign
impl UnwindSafe for TextAlign
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