Style

Struct Style 

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

<style>: Style Information SVG element

Implementations§

Source§

impl<'p> Style<'p>

<style> items

Source

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

Add type attribute

Source

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

Add media attribute

Source

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

Add title attribute

Source

pub fn circle(&mut self) -> Circle<'_>

Add Circle child element

Source

pub fn ellipse(&mut self) -> Ellipse<'_>

Add Ellipse child element

Source

pub fn image(&mut self) -> Image<'_>

Add Image child element

Source

pub fn line(&mut self) -> Line<'_>

Add Line child element

Source

pub fn path(&mut self) -> Path<'_>

Add Path child element

Source

pub fn polygon(&mut self) -> Polygon<'_>

Add Polygon child element

Source

pub fn polyline(&mut self) -> Polyline<'_>

Add Polyline child element

Source

pub fn rect(&mut self) -> Rect<'_>

Add Rect child element

Source

pub fn text(&mut self) -> Text<'_>

Add Text child element

Source

pub fn use(&mut self) -> Use<'_>

Add Use child element

Source

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

Add A child element

Source

pub fn defs(&mut self) -> Defs<'_>

Add Defs child element

Source

pub fn g(&mut self) -> G<'_>

Add G child element

Source

pub fn marker(&mut self) -> Marker<'_>

Add Marker child element

Source

pub fn mask(&mut self) -> Mask<'_>

Add Mask child element

Source

pub fn pattern(&mut self) -> Pattern<'_>

Add Pattern child element

Source

pub fn svg(&mut self) -> Svg<'_>

Add Svg child element

Source

pub fn switch(&mut self) -> Switch<'_>

Add Switch child element

Source

pub fn symbol(&mut self) -> Symbol<'_>

Add Symbol 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_el(&mut self) -> Title<'_>

Add Title child element

Source

pub fn linear_gradient(&mut self) -> LinearGradient<'_>

Add LinearGradient child element

Source

pub fn radial_gradient(&mut self) -> RadialGradient<'_>

Add RadialGradient child element

Source

pub fn stop(&mut self) -> Stop<'_>

Add Stop child element

Source

pub fn clip_path(&mut self) -> ClipPath<'_>

Add ClipPath child element

Source

pub fn filter(&mut self) -> Filter<'_>

Add Filter child element

Source

pub fn foreign_object(&mut self) -> ForeignObject<'_>

Add ForeignObject child element

Source

pub fn script(&mut self) -> Script<'_>

Add Script child element

Source

pub fn style_el(&mut self) -> Style<'_>

Add Style child element

Source

pub fn view(&mut self) -> View<'_>

Add View 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 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 close(&'p mut self) -> &'p mut Page

Close the element

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

Source§

impl<'p> Style<'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 Style<'p>

§

impl<'p> RefUnwindSafe for Style<'p>

§

impl<'p> Send for Style<'p>

§

impl<'p> Sync for Style<'p>

§

impl<'p> Unpin for Style<'p>

§

impl<'p> !UnwindSafe for Style<'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.