You can specify multiple binaries using [[bin]]
, as mentioned here:
[[bin]]
name = "daemon"
path = "src/daemon/bin/main.rs"
[[bin]]
name = "client"
path = "src/client/bin/main.rs"
Tip: If you instead put these files in src/bin/daemon.rs
and src/bin/client.rs
, you’ll get two executables named daemon
and client
as Cargo compiles all files in src/bin
into executables with the same name automatically. You need to specify names and paths like in the snippet above only if you don’t follow this convention.