houqp / leptess

Productive and safe Rust binding for leptonica and tesseract
https://houqp.github.io/leptess/leptess/index.html
MIT License
258 stars 29 forks source link

Refactoring plan #34

Closed ccouzens closed 3 years ago

ccouzens commented 3 years ago

I plan on extracting the layer between the high level Rust interface and the sys crates into a couple other crates.

This roughly corresponds to extracting out https://github.com/houqp/leptess/blob/master/src/leptonica.rs https://github.com/houqp/leptess/blob/master/src/tesseract.rs

And plugging in https://crates.io/crates/tesseract-plumbing and https://crates.io/crates/leptonica-plumbing/0.1.0 to take their place. tesseract-plumbing will need a few additional features before it can take the place with in leptess.

This has a couple advantages to me

  1. I maintain tesseract-rs as well as leptess, and I find it unfortunate that safe wrapping often needs to be implemented twice (once for each project).
  2. By having projects that focus more closely on the safety aspect, it's easier to make sure that they don't break safety rules.

This will break leptess's API. There are one or two API decisions that are only possible by being unsafe. I will post details later.