pub struct SVG { /* private fields */ }Expand description
The representation of a svg element tree.
Implementations§
source§impl SVG
impl SVG
sourcepub fn new(
element: &'static str,
attributes: Vec<(&'static str, String)>,
children: Vec<SVG>
) -> Self
pub fn new( element: &'static str, attributes: Vec<(&'static str, String)>, children: Vec<SVG> ) -> Self
Create a new svg element with given name and attributes.
sourcepub fn insert_attribute<S>(&mut self, keys: &'static str, value: S)where
S: Into<String>,
pub fn insert_attribute<S>(&mut self, keys: &'static str, value: S)where S: Into<String>,
Insert new attribute to current svg node.
sourcepub fn attributes(&self) -> Iter<'_, &'static str, String>
pub fn attributes(&self) -> Iter<'_, &'static str, String>
View all attributes of current svg node.
sourcepub fn attributes_mut(&mut self) -> IterMut<'_, &'static str, String>
pub fn attributes_mut(&mut self) -> IterMut<'_, &'static str, String>
Get mutable reference of all attributes
sourcepub fn insert_child(&mut self, child: SVG)
pub fn insert_child(&mut self, child: SVG)
Insert new child to current svg node.
sourcepub fn children_mut(&mut self) -> IterMut<'_, SVG>
pub fn children_mut(&mut self) -> IterMut<'_, SVG>
Get mutable reference of all children