pub enum HAlign {
Left,
Center,
Right,
}Expand description
Horizontal alignment within a bounded rectangle.
Variants§
Left
Align text to the left edge (default).
Center
Centre text horizontally.
Right
Align text to the right edge.
Implementations§
Source§impl HAlign
impl HAlign
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 HAlign
impl Eq for HAlign
impl StructuralPartialEq for HAlign
Auto Trait Implementations§
impl Freeze for HAlign
impl RefUnwindSafe for HAlign
impl Send for HAlign
impl Sync for HAlign
impl Unpin for HAlign
impl UnsafeUnpin for HAlign
impl UnwindSafe for HAlign
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