Struct pixel_widgets::text::Text [−][src]
pub struct Text<'a> { pub text: Cow<'a, str>, pub font: Font, pub size: f32, pub wrap: TextWrap, pub color: Color, }
Expand description
A styled paragraph of text
Fields
text: Cow<'a, str>
The text
font: Font
Font to render the text with
size: f32
Font size to render the text with
wrap: TextWrap
Wrapping style to use
color: Color
Color to render the text with
Implementations
impl<'t> Text<'t>
[src]
impl<'t> Text<'t>
[src]pub fn measure(&self, rect: Option<Rectangle>) -> Rectangle
[src]
pub fn measure(&self, rect: Option<Rectangle>) -> Rectangle
[src]Measure the size of the text. If a rectangle is supplied and the text wraps, the layout will stay within the width of the given rectangle.
Trait Implementations
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
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> Pointable for T
impl<T> Pointable for T
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more