pub enum Align {
Left,
Center,
Right,
}Expand description
Variants§
Left
Text starts at the left edge; leftover space trails on the right.
Center
Leftover space is split evenly on both sides (an odd extra column goes on the right).
Right
Text ends at the right edge; leftover space leads on the left.
Implementations§
Source§impl Align
impl Align
Sourcepub const fn offset(self, area_width: u16, content_width: u16) -> u16
pub const fn offset(self, area_width: u16, content_width: u16) -> u16
The left offset, in columns, at which a content_width-column line
should start within an area_width-column area for this alignment.
Saturates at 0 when the content is wider than the area, so the caller
clips from the left edge rather than underflowing.
Trait Implementations§
impl Copy for Align
impl Eq 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