Struct svg_definitions::Element
source · pub struct Element { /* private fields */ }
Expand description
Element provides a way to simulate DOM SVG elements
Implementations§
source§impl Element
impl Element
sourcepub fn append(self, child: Element) -> Self
pub fn append(self, child: Element) -> Self
Appends an element to the children of the self element and consumes both whilst returning the product
sourcepub fn set_inner(self, text: &str) -> Self
pub fn set_inner(self, text: &str) -> Self
Sets the inner text to a plain string Allowed characters are a-zA-Z0-9’“ -_/.!?:;(){}[]`~&,
sourcepub fn set<T>(self, attribute: Attribute, value: T) -> Selfwhere
T: ToString,
pub fn set<T>(self, attribute: Attribute, value: T) -> Selfwhere
T: ToString,
Sets an attribute of the self element to a certain value
sourcepub fn get_tag_name(&self) -> &TagName
pub fn get_tag_name(&self) -> &TagName
Gets an immutable reference to the tag_name of this Element
sourcepub fn get_attributes(&self) -> &HashMap<Attribute, String>
pub fn get_attributes(&self) -> &HashMap<Attribute, String>
Gets an immutable reference to the attributes of this Element
sourcepub fn get_children(&self) -> &Vec<Element>
pub fn get_children(&self) -> &Vec<Element>
Gets an immutable reference to the children of this Element