Hi, sorry, this must be an age-old question, but all my searches regarding Rust/Python communication seem to be building modules you can call from python, not the other way around.
Let's say I have some pretty rust data-structure that encapsulates all the data needed to then be formatted into a Word Doc, and say the rust ecosystem for creating word docs is a little under developed still. I want to ship my data somehow to python and build my docx from there - where the ecosystem is much more developed.
The way I was thinking was to use serde to serialize my data - use std::Command to call a python script that is expecting to read the data from stdin via a pipe, python deserializes and then creates the docx for me.
Is there a better or more standard/idiomatic way to do this?
I like my idea of serde + Command + pipe because compile times are already a bit too large for my tastes, so i don't want to pull in new libraries for the fringe parts of my codebase, and the FFI boundary is going to be very infrequently modified, so I'm happy to duplicate code on the python side, and then I still get a pure python environment to write my python code in.