Trait usvg::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.

Object Safety§

This trait is not object safe.

Implementors§