fschutt / printpdf

An easy-to-use library for writing PDF in Rust
https://docs.rs/printpdf/
MIT License
802 stars 96 forks source link

Use rust life times instead of Rc<> #81

Open fd opened 3 years ago

fd commented 3 years ago

@fschutt Are you okay If I attempt to refactor the library such that PageRef and LayerRef types actually use rust life times instead of Rc<>? This would obviously be a breaking change but I believe it would more accurately communicate mutability and ownership of the referenced data.

fschutt commented 3 years ago

You can do it, but it would likely be a waste of time, see https://github.com/fschutt/printpdf/issues/73#issuecomment-712794370

I'll refactor the API properly in the next version anyway, so the PageRef and LayerRef classes will be removed.

fd commented 3 years ago

Yeah I saw you wanted to do a rewrite in a few years (aka. not today). My immediate goals are:

These changes could be a stepping stone to a more convenient v2 API.

fschutt commented 3 years ago

ok, go ahead if you want