pub struct Text(/* private fields */);
Expand description
Text layout object.
Implementations§
Source§impl Text
impl Text
Sourcepub fn create(e: &Element, text: &str) -> Result<Text>
pub fn create(e: &Element, text: &str) -> Result<Text>
Create a text layout object on top of a host element.
Sourcepub fn with_class(e: &Element, text: &str, class: &str) -> Result<Text>
pub fn with_class(e: &Element, text: &str, class: &str) -> Result<Text>
Create a text layout object on top of a host element with the specified class
attribute.
Sourcepub fn with_style(e: &Element, text: &str, styles: &str) -> Result<Text>
pub fn with_style(e: &Element, text: &str, styles: &str) -> Result<Text>
Create a text layout object on top of a host element with the specified style
attribute.
Sourcepub fn set_box(&mut self, size: Size) -> Result<()>
pub fn set_box(&mut self, size: Size) -> Result<()>
Sets the box width
and height
of the text object.
Sourcepub fn get_metrics(&self) -> Result<TextMetrics>
pub fn get_metrics(&self) -> Result<TextMetrics>
Returns metrics of the text layout object.
Trait Implementations§
Source§impl Clone for Text
Copies text object.
impl Clone for Text
Copies text object.
All allocated objects are reference counted so copying is just a matter of increasing reference counts.
Auto Trait Implementations§
impl Freeze for Text
impl RefUnwindSafe for Text
impl !Send for Text
impl !Sync for Text
impl Unpin for Text
impl UnwindSafe for Text
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