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>) - FeGaussian
Blur - feGaussianBlur filter primitive
- Filter
- SVG filter element (
<filter>) - Gradient
Stop - Gradient stop element (
<stop>) - Group
- SVG group element (
<g>) - Image
- SVG image element (
<image>) - Line
- SVG line element (
<line>) - Linear
Gradient - SVG linearGradient element (
<linearGradient>) - Marker
- SVG marker element (
<marker>) - Path
- SVG path element (
<path>) - Path
Data - Structured SVG path data
- Path
Data Proxy - Proxy type for PathData - serializes as a string
- Point
- A single point in SVG coordinates
- Points
- Structured SVG points list (for polygon/polyline)
- Points
Proxy - 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§
- Filter
Primitive - Filter primitive elements
- Path
Command - A single SVG path command
- SvgNode
- Any SVG node we care about
Constants§
- SVG_NS
- SVG namespace URI
Functions§
Type Aliases§
- Error
- Error type for SVG parsing
- Serialize
Error - Error type for SVG serialization