Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Document
✓ use svg::Document;
Create and save an SVG document with a rectangle
use svg::Document;
use svg::node::element::Rectangle;
fn main() {
let doc = Document::new()
.set("viewBox", (0, 0, 100, 100))
.add(Rectangle::new()
.set("x", 10)
.set("y", 10)
.set("width", 80)
.set("height", 80));
svg::save("output.svg", &doc).unwrap();
}
Debug
Known issues
No known issues recorded.
Upgrade
Version history
0.18.0latest on crates.io
Audit
Dependencies
No dependency data recorded yet.