Crate facet_svg

Crate facet_svg 

Source
Expand description

Facet-derived types for SVG parsing and serialization.

This crate provides strongly-typed SVG elements that can be deserialized from XML using facet-xml.

§Example

use facet_svg::Svg;

let svg_str = r#"<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100">
    <rect x="10" y="10" width="80" height="80" fill="blue"/>
</svg>"#;

let svg: Svg = facet_svg::from_str(svg_str).unwrap();

Re-exports§

pub use facet_xml;

Macros§

trace
Emit a trace-level log message (no-op version).

Structs§

Circle
SVG circle element (<circle>)
Defs
SVG defs element (<defs>)
Desc
SVG description element (<desc>)
Ellipse
SVG ellipse element (<ellipse>)
FeGaussianBlur
feGaussianBlur filter primitive
Filter
SVG filter element (<filter>)
GradientStop
Gradient stop element (<stop>)
Group
SVG group element (<g>)
Image
SVG image element (<image>)
Line
SVG line element (<line>)
LinearGradient
SVG linearGradient element (<linearGradient>)
Marker
SVG marker element (<marker>)
Path
SVG path element (<path>)
PathData
Structured SVG path data
PathDataProxy
Proxy type for PathData - serializes as a string
Point
A single point in SVG coordinates
Points
Structured SVG points list (for polygon/polyline)
PointsProxy
Proxy type for Points - serializes as a string
Polygon
SVG polygon element (<polygon>)
Polyline
SVG polyline element (<polyline>)
Rect
SVG rect element (<rect>)
Style
SVG style element (<style>)
Svg
Root SVG element
Symbol
SVG symbol element (<symbol>)
Text
SVG text element (<text>)
Title
SVG title element (<title>)
Use
SVG use element (<use>)

Enums§

FilterPrimitive
Filter primitive elements
PathCommand
A single SVG path command
SvgNode
Any SVG node we care about

Constants§

SVG_NS
SVG namespace URI

Functions§

from_str
Deserialize an SVG from a string.
to_string
Serialize an SVG value to a string.

Type Aliases§

Error
Error type for SVG parsing
SerializeError
Error type for SVG serialization