Viaduct replacement demo
This shows off a potential viaduct replacement that uses new UniFFI features.
The 1000ft view is that:
- We define an HTTP backend trait in Rust (note that the method is async, via the
async_traitcrate) - We can implement that trait in Rust
- or implement it in Python
- We initialize the crate with one of those backends
- Then we can make HTTP requests in Rust, independent of the implementation.
Check out the fairy-bridge README and the demo README for details. Execute run-demo.py to test it out yourself.
The UniFFI features are still a WIP. This is currently using a branch in my repo. The current plan for getting these into UniFFI main is:
- Get the
0.26.0release out the door - Merge PR #1818 into
main - Merge my
async-trait-interfacesbranch into main (probably using a few smaller PRs)
The Desktop plan needs to be explored more. I believe there should be a way to use Necko in Rust code, but that needs to be verified.
I made this using UniFFI proc-macros, to test out the technology and I have to say it was very pleasant to work with.
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Please upload report for BASE (
main@a8c15ba). Learn more about missing BASE report.
Additional details and impacted files
@@ Coverage Diff @@
## main #6018 +/- ##
=======================================
Coverage ? 22.64%
=======================================
Files ? 330
Lines ? 29814
Branches ? 0
=======================================
Hits ? 6750
Misses ? 23064
Partials ? 0
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Thanks for the review! I just updated a bunch of code based on the suggestions. I think you're right that the real interesting part will come from integrating with Necko. If the UniFFI bits are the boring part, I guess that's a good sign.