Struct usvg::tree::Tree
[−]
[src]
pub struct Tree { /* fields omitted */ }
A nodes tree container.
Methods
impl Tree
[src]
pub fn create(svg: Svg) -> Self
[src]
Creates a new Tree
.
pub fn root(&self) -> Node
[src]
Returns the Svg
node.
pub fn svg_node(&self) -> Ref<Svg>
[src]
Returns the Svg
node value.
pub fn defs(&self) -> Node
[src]
Returns the Defs
node.
pub fn is_in_defs(&self, node: &Node) -> bool
[src]
Checks that node
is part of the Defs
children.
pub fn append_to_defs(&mut self, kind: NodeKind) -> Node
[src]
Appends NodeKind
to the Defs
node.
pub fn defs_by_id(&self, id: &str) -> Option<Node>
[src]
Searches for NodeId
in Defs
children by ID.
pub fn node_by_svg_id(&self, id: &str) -> Option<Node>
[src]
Returns renderable node by ID.
If an empty ID is provided, than this method will always return None
.
Even if tree has nodes with empty ID.
pub fn to_svgdom(&self) -> Document
[src]
Converts the document to svgdom::Document
.
Used to save document to file for debug purposes.