Skip to content

Expose controller layer from the crate

Patrik requested to merge PatrikStas/vdr-tools:crate/publish-api into main

In order to enable direct consumption of vdr-tools from other Rust crate, I am proposing this PR to:

  • expose Controller layer to represent Rust API of the crate, service layer stays invisible for the consumer
  • additionally it's also needed to expose domain module for datastructures and utils mainly for logger. The utils module could be perhaps split in 2, something like utils (crate api, pub), and utils_internal (private to crate; pub(crate))
  • This would also enable writing unit tests against the rust api, instead of testing through FFI api - so experimentally I've created libindy/tests/ledger_service.rs as example. This would be more pragmatic and convenient approach, but on the other hand it doesn't verify the C-layer (which is maybe desirable property for you).
  • Example project using this vdr-tools Rust API via crate dependency https://github.com/Patrik-Stas/consume-indy-crate/blob/master/src/libindy_async.rs

Let me know what you think.

Signed-off-by: Patrik Stas patrik.stas@absa.africa

Merge request reports