Struct embedded_graphics::fonts::Text
source · 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> PartialEq for Text<'a>
impl<'a> PartialEq for Text<'a>
source§impl<'a> PartialOrd for Text<'a>
impl<'a> PartialOrd for Text<'a>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl<'a> Copy for Text<'a>
impl<'a> Eq for Text<'a>
impl<'a> StructuralPartialEq for Text<'a>
Auto Trait Implementations§
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