pub struct Text(_);
Expand description
Text layout object.
Implementations
sourceimpl 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
sourceimpl Clone for Text
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 RefUnwindSafe for Text
impl !Send for Text
impl !Sync for Text
impl Unpin for Text
impl UnwindSafe for Text
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
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more