[−][src]Struct embedded_text::TextBox
A textbox object.
The TextBox struct represents a piece of text that can be drawn on a display inside the given
bounding box.
The struct only contains the text and the bounding box, no additional information. To draw
a textbox it is necessary to attach a style to it using the into_styled method to create a
StyledTextBox object.
See the module-level documentation for more information.
Fields
text: &'a strThe text to be displayed in this TextBox
bounds: RectangleThe bounding box of this TextBox
Implementations
impl<'a> TextBox<'a>[src]
#[must_use]pub fn new(text: &'a str, bounds: Rectangle) -> Self[src]
Creates a new TextBox instance with a given bounding Rectangle.
#[must_use]pub fn into_styled<C, F, A, V>(
self,
style: TextBoxStyle<C, F, A, V>
) -> StyledTextBox<'a, C, F, A, V> where
C: PixelColor,
F: Font + Copy,
A: HorizontalTextAlignment,
V: VerticalTextAlignment, [src]
self,
style: TextBoxStyle<C, F, A, V>
) -> StyledTextBox<'a, C, F, A, V> where
C: PixelColor,
F: Font + Copy,
A: HorizontalTextAlignment,
V: VerticalTextAlignment,
Attaches a TextBoxStyle to the textbox object.
Trait Implementations
impl<'_> Dimensions for TextBox<'_>[src]
#[must_use]fn top_left(&self) -> Point[src]
#[must_use]fn bottom_right(&self) -> Point[src]
#[must_use]fn size(&self) -> Size[src]
impl<'_> Transform for TextBox<'_>[src]
Auto Trait Implementations
impl<'a> RefUnwindSafe for TextBox<'a>
impl<'a> Send for TextBox<'a>
impl<'a> Sync for TextBox<'a>
impl<'a> Unpin for TextBox<'a>
impl<'a> UnwindSafe for TextBox<'a>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,