pub struct Align<T: Renderable> {
pub renderable: T,
pub align: AlignMethod,
pub vertical: VerticalAlignMethod,
pub width: Option<usize>,
pub height: Option<usize>,
}Expand description
Wraps a renderable to apply horizontal and/or vertical alignment.
Fields§
§renderable: T§align: AlignMethod§vertical: VerticalAlignMethod§width: Option<usize>§height: Option<usize>Implementations§
Source§impl<T: Renderable> Align<T>
impl<T: Renderable> Align<T>
Sourcepub fn align(self, align: AlignMethod) -> Self
pub fn align(self, align: AlignMethod) -> Self
Set the horizontal alignment.
pub fn vertical(self, vertical: VerticalAlignMethod) -> Self
pub fn center(renderable: T) -> Self
pub fn middle(renderable: T) -> Self
Trait Implementations§
Source§impl<T: Renderable + Clone> Renderable for Align<T>
impl<T: Renderable + Clone> Renderable for Align<T>
Source§fn render(&self, options: &ConsoleOptions) -> RenderResult
fn render(&self, options: &ConsoleOptions) -> RenderResult
Render this object into a
RenderResult using the provided options. Read moreSource§fn measure(&self, _options: &ConsoleOptions) -> Option<Measurement>
fn measure(&self, _options: &ConsoleOptions) -> Option<Measurement>
Optional width-measurement hook (equivalent to
__rich_measure__).
Override to provide min/max width constraints for layout.Auto Trait Implementations§
impl<T> Freeze for Align<T>where
T: Freeze,
impl<T> RefUnwindSafe for Align<T>where
T: RefUnwindSafe,
impl<T> Send for Align<T>where
T: Send,
impl<T> Sync for Align<T>where
T: Sync,
impl<T> Unpin for Align<T>where
T: Unpin,
impl<T> UnsafeUnpin for Align<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for Align<T>where
T: UnwindSafe,
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