Given a Cargo workspace in one git repository that contains one crate foo, and another crate bar outside of that workspace, how do I depend on foo in bar? If foo were just a regular crate-within-a-git-repo, the following works:
foo = { git = "ssh://git@server/some/foo.git", ... }
And if foo were inside a Cargo workspace and it lives in a local directory, the following works:
foo = { path = "../../some-workspace/foo" }
But using git = "ssh://..." that points to a repository that contains a Cargo workspace, I am unable to specify the foo crate in particular.
It is not possible to combine git = "..." and path = "...", since those are mutually exclusive.
In the Specifying dependencies from git repositories chapter of The Cargo Book, it offers branch = "...", tag = "...", rev = "...", but no "sub-crate's directory name, i.e. the name of the crate". There is a package = "..." specifier mentioned under Renaming dependencies in Cargo.toml meant for importing a crate as something else. But it doesn't seem to double as the crate-within-a-workspace specifier.