How do I share common code between Rust projects without publishing to crates.io? -


there may not answer question, have code share between 2 different rust projects without publishing crate crates.io.

the code proprietary , don't want put out wild.

but it's proprietary code , don't want put out wild.

you don't have publish crate. specifically, create crate (cargo new shared_stuff) specify path common crate(s) in dependent project's cargo.toml:

[dependency.shared_stuff] path = "path/to/shared/crate" 

the cargo documentation has entire section on types of dependencies:

i believe cargo allow fetch private git repository (such on github or privately hosted service, such gitlab), haven't tried personally. based on searching, need have authenticated or otherwise configured git not require interactive password entry.


it's theoretically possible create own crate registry. i've not attempted this, machinery present in cargo handle it.


Popular posts from this blog

php - How should I create my API for mobile applications (Needs Authentication) -

5 Reasons to Blog Anonymously (and 5 Reasons Not To)

Google AdWords and AdSense - A Dynamic Small Business Marketing Duo