pub struct Tree { /* private fields */ }Expand description
A nodes tree container.
Implementations
sourceimpl Tree
impl Tree
sourcepub fn from_data(data: &[u8], opt: &OptionsRef<'_>) -> Result<Self, Error>
pub fn from_data(data: &[u8], opt: &OptionsRef<'_>) -> Result<Self, Error>
Parses Tree from an SVG data.
Can contain an SVG string or a gzip compressed data.
sourcepub fn from_str(text: &str, opt: &OptionsRef<'_>) -> Result<Self, Error>
pub fn from_str(text: &str, opt: &OptionsRef<'_>) -> Result<Self, Error>
Parses Tree from an SVG string.
sourcepub fn from_xmltree(
doc: &Document<'_>,
opt: &OptionsRef<'_>
) -> Result<Self, Error>
pub fn from_xmltree(
doc: &Document<'_>,
opt: &OptionsRef<'_>
) -> Result<Self, Error>
Parses Tree from roxmltree::Document.
sourcepub fn is_in_defs(&self, node: &Node) -> bool
pub fn is_in_defs(&self, node: &Node) -> bool
Checks that node is part of the Defs children.
sourcepub fn append_to_defs(&mut self, kind: NodeKind) -> Node
pub fn append_to_defs(&mut self, kind: NodeKind) -> Node
Appends NodeKind to the Defs node.
sourcepub fn defs_by_id(&self, id: &str) -> Option<Node>
pub fn defs_by_id(&self, id: &str) -> Option<Node>
Returns defs child node by ID.
sourcepub fn node_by_id(&self, id: &str) -> Option<Node>
pub fn node_by_id(&self, id: &str) -> Option<Node>
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_string(&self, opt: &XmlOptions) -> String
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Tree
impl !Send for Tree
impl !Sync for Tree
impl Unpin for Tree
impl !UnwindSafe for Tree
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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