Text

Struct Text 

Source
pub struct Text<'p> { /* private fields */ }
Expand description

<text>: Text SVG element

Implementations§

Source§

impl<'p> Text<'p>

<text> items

Source

pub fn cdata<'a, V>(&mut self, text: V) -> &mut Self
where V: Into<Value<'a>>,

Add character data content

These characters will be replaced with entities:

CharEntity
&&amp;
<&lt;
>&gt;
Source

pub fn cdata_len<'a, V>(&mut self, text: V, len: usize) -> &mut Self
where V: Into<Value<'a>>,

Add character data content with a maximum character limit

CharEntity
&&amp;
<&lt;
>&gt;
Source

pub fn comment<'v, V>(&mut self, com: V) -> &mut Self
where V: Into<Value<'v>>,

Add a comment

These characters will be replaced with entities:

CharEntity
-&hyphen;
<&gt;
>&lt;
Source

pub fn raw(&mut self, trusted: impl AsRef<str>) -> &mut Self

Add raw content

WARNING: trusted is used verbatim, with no escaping; do not call with untrusted content.

Source

pub fn x<'a, V>(&mut self, val: V) -> &mut Self
where V: Into<Value<'a>>,

Add x attribute

Source

pub fn y<'a, V>(&mut self, val: V) -> &mut Self
where V: Into<Value<'a>>,

Add y attribute

Source

pub fn dx<'a, V>(&mut self, val: V) -> &mut Self
where V: Into<Value<'a>>,

Add dx attribute

Source

pub fn dy<'a, V>(&mut self, val: V) -> &mut Self
where V: Into<Value<'a>>,

Add dy attribute

Source

pub fn rotate<'a, V>(&mut self, val: V) -> &mut Self
where V: Into<Value<'a>>,

Add rotate attribute

Source

pub fn length_adjust<'a, V>(&mut self, val: V) -> &mut Self
where V: Into<Value<'a>>,

Add lengthAdjust attribute

Source

pub fn text_length<'a, V>(&mut self, val: V) -> &mut Self
where V: Into<Value<'a>>,

Add textLength attribute

Source

pub fn text_anchor<'a, V>(&mut self, val: V) -> &mut Self
where V: Into<Value<'a>>,

Add text-anchor attribute

Source

pub fn required_extensions<'a, V>(&mut self, val: V) -> &mut Self
where V: Into<Value<'a>>,

Add requiredExtensions attribute

Source

pub fn system_language<'a, V>(&mut self, val: V) -> &mut Self
where V: Into<Value<'a>>,

Add systemLanguage attribute

Source

pub fn tspan(&mut self) -> TSpan<'_>

Add TSpan child element

Source

pub fn text_path(&mut self) -> TextPath<'_>

Add TextPath child element

Source

pub fn a(&mut self) -> A<'_>

Add A child element

Source

pub fn desc(&mut self) -> Desc<'_>

Add Desc child element

Source

pub fn metadata(&mut self) -> Metadata<'_>

Add Metadata child element

Source

pub fn title(&mut self) -> Title<'_>

Add Title child element

Source

pub fn animate(&mut self) -> Animate<'_>

Add Animate child element

Source

pub fn animate_motion(&mut self) -> AnimateMotion<'_>

Add AnimateMotion child element

Source

pub fn animate_transform(&mut self) -> AnimateTransform<'_>

Add AnimateTransform child element

Source

pub fn mpath(&mut self) -> MPath<'_>

Add MPath child element

Source

pub fn set(&mut self) -> Set<'_>

Add Set child element

Source

pub fn close(&'p mut self) -> &'p mut Page

Close the element

Adds the closing tag if necessary (e.g. </text>).

Source§

impl<'p> Text<'p>

Global SVG attributes

Source

pub fn id<'a, V>(&mut self, val: V) -> &mut Self
where V: Into<Value<'a>>,

Add id attribute

Source

pub fn class<'a, V>(&mut self, val: V) -> &mut Self
where V: Into<Value<'a>>,

Add class attribute

Source

pub fn style<'a, V>(&mut self, val: V) -> &mut Self
where V: Into<Value<'a>>,

Add style attribute

Source

pub fn autofocus(&mut self) -> &mut Self

Add autofocus Boolean attribute

Source

pub fn lang<'a, V>(&mut self, val: V) -> &mut Self
where V: Into<Value<'a>>,

Add lang attribute

Source

pub fn tabindex<'a, V>(&mut self, val: V) -> &mut Self
where V: Into<Value<'a>>,

Add tabindex attribute

Source

pub fn transform<'a, V>(&mut self, val: V) -> &mut Self
where V: Into<Value<'a>>,

Add transform attribute

Auto Trait Implementations§

§

impl<'p> Freeze for Text<'p>

§

impl<'p> RefUnwindSafe for Text<'p>

§

impl<'p> Send for Text<'p>

§

impl<'p> Sync for Text<'p>

§

impl<'p> Unpin for Text<'p>

§

impl<'p> !UnwindSafe for Text<'p>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.