Trait TreeParsing

Source
pub trait TreeParsing: Sized {
    // Required methods
    fn from_data(data: &[u8], opt: &Options) -> Result<Self, Error>;
    fn from_str(text: &str, opt: &Options) -> Result<Self, Error>;
    fn from_xmltree(doc: &Document<'_>, opt: &Options) -> Result<Self, Error>;
}
Expand description

A trait to parse usvg_tree::Tree from various sources.

Required Methods§

Source

fn from_data(data: &[u8], opt: &Options) -> Result<Self, Error>

Parses Tree from an SVG data.

Can contain an SVG string or a gzip compressed data.

Source

fn from_str(text: &str, opt: &Options) -> Result<Self, Error>

Parses Tree from an SVG string.

Source

fn from_xmltree(doc: &Document<'_>, opt: &Options) -> Result<Self, Error>

Parses Tree from roxmltree::Document.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl TreeParsing for Tree

Source§

fn from_data(data: &[u8], opt: &Options) -> Result<Self, Error>

Parses Tree from an SVG data.

Can contain an SVG string or a gzip compressed data.

Source§

fn from_str(text: &str, opt: &Options) -> Result<Self, Error>

Parses Tree from an SVG string.

Source§

fn from_xmltree(doc: &Document<'_>, opt: &Options) -> Result<Self, Error>

Parses Tree from roxmltree::Document.

Implementors§