pub struct Text<'a> {
pub text: &'a str,
pub position: Point,
}
Expand description
A text object.
The Text
struct represents a string that can be drawn onto a display.
The text object only contains the string and position and no additional styling information,
like the font or color. To draw a text object it is necessary to attach a style to it by using
the into_styled
method to create a Styled
object.
See the module-level documentation for examples how to use text objects.
Fields§
§text: &'a str
The string.
position: Point
The position.
Defines the top-left starting pixel of the text object.
Implementations§
Trait Implementations§
Source§impl<'a> Ord for Text<'a>
impl<'a> Ord for Text<'a>
Source§impl<'a> PartialOrd for Text<'a>
impl<'a> PartialOrd for Text<'a>
impl<'a> Copy for Text<'a>
impl<'a> Eq for Text<'a>
impl<'a> StructuralPartialEq for Text<'a>
Auto Trait Implementations§
impl<'a> Freeze for Text<'a>
impl<'a> RefUnwindSafe for Text<'a>
impl<'a> Send for Text<'a>
impl<'a> Sync for Text<'a>
impl<'a> Unpin for Text<'a>
impl<'a> UnwindSafe for Text<'a>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 16 bytes