#[non_exhaustive]pub struct TextLayout {
pub max_width: Option<u32>,
pub align: Align,
pub markup: bool,
}Expand description
How a text is laid out.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.max_width: Option<u32>The widest a line may be, in the font’s pixels, before it wraps;
None wraps only at \n.
A line breaks at its last run of spaces before a character that would pass it, and the spaces of that run are dropped. A word wider than the width alone breaks between its characters, with one at least on each line, so a line may still be wider.
align: AlignWhere each line goes across the block.
markup: boolWhether the color markup is read: {c:#ff0} starts a run of a
color, {/c} ends it, and {{ is a {. Off, every character is
drawn as it is.
Implementations§
Source§impl TextLayout
impl TextLayout
Trait Implementations§
Source§impl Clone for TextLayout
impl Clone for TextLayout
impl Copy for TextLayout
Source§impl Debug for TextLayout
impl Debug for TextLayout
Source§impl Default for TextLayout
impl Default for TextLayout
impl Eq for TextLayout
Source§impl Hash for TextLayout
impl Hash for TextLayout
Source§impl PartialEq for TextLayout
impl PartialEq for TextLayout
impl StructuralPartialEq for TextLayout
Auto Trait Implementations§
impl Forget for TextLayout
impl Freeze for TextLayout
impl Move for TextLayout
impl RefUnwindSafe for TextLayout
impl Send for TextLayout
impl Sync for TextLayout
impl Unpin for TextLayout
impl UnsafeUnpin for TextLayout
impl UnwindSafe for TextLayout
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