pub struct SVG { /* private fields */ }Expand description
The representation of a svg element tree.
Implementations
sourceimpl 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
Trait Implementations
impl Eq for SVG
impl StructuralEq for SVG
impl StructuralPartialEq for SVG
Auto Trait Implementations
impl RefUnwindSafe for SVG
impl Send for SVG
impl Sync for SVG
impl Unpin for SVG
impl UnwindSafe for SVG
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
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.
sourcefn clone_into(&self, target: &mut T)
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