Crate svgdom [−] [src]
This library is designed to represent SVG data as a tree structure.
Here is simple overview of such structure:
The Document
itself is just a container of Node
s.
You can create new Node
s only through the Document
. Parsing and generating of the SVG data also
done through it.
The Node
represents any kind of an XML node.
It can be an element, a comment, a text, etc. There are no different structs for each type.
The TagName
represents a tag name of the element node. It's an enum of
ElementId
and String
types. The ElementId
contains all possible
SVG element names and String
used for non-SVG elements. Such separation used for
performance reasons.
The Attributes
container wraps a Vec
of Attribute
's.
At last, the id
attribute is stored as a separate value and not as part of the Attributes
.
See modules and structs documentation for details.
Modules
postproc |
This module contains functions that can be useful for SVG document post-processing. |
types |
This module contains submodules which represent SVG value types. |
Macros
assert_eq_text |
Structs
Attribute |
Representation of the SVG attribute object. |
Attributes |
Wrapper around attributes list. |
Children |
An iterator of |
Descendants |
An iterator of |
Document |
Container of |
ErrorPos |
Position of an error. |
LinkedNodes |
An iterator over linked nodes. |
Node |
Representation of the SVG node. |
Parents |
An iterator of |
ParseOptions |
Options that defines SVG parsing. |
Traverse |
An iterator of |
WriteOptions |
Options that defines SVG writing. |
WriteOptionsPaths |
Options that defines SVG paths writing. |
Enums
AttributeId |
List of all SVG attributes. |
AttributeValue |
Value of the SVG attribute. |
ElementId |
List of all SVG elements. |
Error |
List of all errors that can occur during processing of the SVG DOM. |
Indent |
XML node indention |
Name |
A container for an SVG item name. |
NameRef |
A reference-like container for a |
NodeEdge |
Node type during traverse. |
NodeType |
List of supported node types. |
ValueId |
List of values for presentation attributes. |
Traits
AttributeType |
This trait contains methods that check attribute's type according to the SVG spec. |
ElementType |
This trait contains methods that check element's type according to the SVG spec. |
FromStream |
The trait for parsing data from the data stream. |
SvgId |
A trait for SVG id's. |
WriteBuffer |
The trait for writing a data to the buffer. |
WriteToString |
The trait for writing data to the |
Type Definitions
AttributeName |
Type alias for |
AttributeNameRef |
Type alias for |
SvgAttrFilter |
Filter iterator over SVG attributes. |
SvgAttrFilterMut |
Mutable filter iterator over SVG attributes. |
TagName |
Type alias for |
TagNameRef |
Type alias for |