I want to know if there is a way for a rust lib or bin to have dependencies on other rust crates which are not open (source is not visible and completely closed). I might open source the lib which uses these closed source rust crate dependencies.
You will almost certainly have to compile your closed source code as cdylib with a C ABI and then write the open source part as wrapper around the C ABI. Rust doesn't have a stable ABI or crate metadata format and as such a precompiled rust dependency won't work with any rustc version other than the one you compiled it with. Also the crate metadata leaks a fair bit of private information.
3 Likes