Struct embedded_graphics::fonts::Text
source · [−]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
sourceimpl<'a> Ord for Text<'a>
impl<'a> Ord for Text<'a>
sourceimpl<'a> PartialOrd<Text<'a>> for Text<'a>
impl<'a> PartialOrd<Text<'a>> for Text<'a>
sourcefn partial_cmp(&self, other: &Text<'a>) -> Option<Ordering>
fn partial_cmp(&self, other: &Text<'a>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
impl<'a> Copy for Text<'a>
impl<'a> Eq for Text<'a>
impl<'a> StructuralEq 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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more