Finish the rust API for librsvg_crate
In the wip/rust-api branch there is a new proposed Rust-only API for a new librsvg
crate, intended to be consumed by Rust programs directly, without linking to the system's librsvg.so
.
The API is incomplete right now, but follows this pattern:
- There is a
LoadOptions
struct with a builder pattern; this builds up what in the C API were theRsvgHandleFlags
. -
LoadOptions.read_*()
loads the SVG data into anSvgHandle
. From the handle, one can get a Cairo renderer. -
CairoRenderer
has the geometry and rendering functions.
Missing things:
-
get_geometry_sub
forCairoRenderer
-
Finish the dimensions-api
branch and putget_intrinsic_dimensions
inCairoRenderer
- #396 (closed) -
Loading functions for gio::File
andgio::InputStream
, inLoadOptions
. -
render_element
inCairoRenderer
, akin torsvg_handle_render_cairo_sub
. -
(longer term; not needed for initial release) Figure out if LoadingError
andRenderingError
should stay how they are, or if they should provide more detailed information (which element failed, for example). #424 (closed)
Edited by Federico Mena Quintero