[−][src]Struct usvg::Tree
A nodes tree container.
Implementations
impl Tree
[src]
pub fn from_data(data: &[u8], opt: &Options) -> Result<Self, Error>
[src]
Parses Tree
from the SVG data.
Can contain an SVG string or a gzip compressed data.
pub fn from_str(text: &str, opt: &Options) -> Result<Self, Error>
[src]
Parses Tree
from the SVG string.
pub fn from_xmltree(doc: &Document<'_>, opt: &Options) -> Result<Self, Error>
[src]
Parses Tree
from roxmltree::Document
.
pub fn from_file<P: AsRef<Path>>(path: P, opt: &Options) -> Result<Self, Error>
[src]
Parses Tree
from the file.
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]
Returns defs
child node by ID.
pub fn node_by_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_string(&self, opt: XmlOptions) -> String
[src]
Converts an SVG.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Tree
[src]
impl !Send for Tree
[src]
impl !Sync for Tree
[src]
impl Unpin for Tree
[src]
impl !UnwindSafe for Tree
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,