[Solved] Maximum uncoupling: Rust apps using a Rust library


Solved: cargo takes care of it.


I have a Rust library that is the basis for various Rust apps. A Rust app provides app specific callbacks implementing the traits defined by the library. In C the app would typically only read the header files and link with the binary library. How does this work with Rust? So far I can only see that each app must be compiled with the library source… I would very much appreciate some pointers to the relevant documentation. Thanks.


Note that Rust performs static linking by default, whereas C programs often link dynamically, and cargo builds a separate version of the dependency under the target directory of each crate.