pub enum Alignment {
Left,
Center,
Right,
}Expand description
Specifies the alignment direction for text.
This enum defines the three possible alignment options that can be used with the alignment functions.
§Examples
use ansi_align::{Alignment, AlignOptions, ansi_align_with_options};
let text = "hello\nworld";
// Center alignment
let opts = AlignOptions::new(Alignment::Center);
let result = ansi_align_with_options(text, &opts);
// Right alignment
let opts = AlignOptions::new(Alignment::Right);
let result = ansi_align_with_options(text, &opts);Variants§
Left
Align text to the left (no padding added to the left side)
Center
Align text to the center (padding distributed evenly on both sides)
Right
Align text to the right (padding added to the left side)
Trait Implementations§
impl Copy for Alignment
impl Eq for Alignment
impl StructuralPartialEq for Alignment
Auto Trait Implementations§
impl Freeze for Alignment
impl RefUnwindSafe for Alignment
impl Send for Alignment
impl Sync for Alignment
impl Unpin for Alignment
impl UnwindSafe for Alignment
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