Problem
Cannot access ServerConnection
which is in /src/gameclient/server_connection.rs
from /src/bin/client.rs
.
I dont have any lib.rs
nor main.rs
all binaries are in /src/bin/
Project structure
Cargo.toml
...
[[bin]]
name = "server"
path = "src/bin/server.rs"
[[bin]]
name = "client"
path = "src/bin/client.rs"
...
/src/gameclient/mod.rs
rust-analyzer already complains here with:
file not included in module tree
pub mod player_instance;
pub use crate::gameclient::player_instance::PlayerInstance;
pub mod server_connection;
pub use crate::gameclient::server_connection::ServerConnection;
/src/gameclient/server_connection/ServerConnection
...
pub struct ServerConnection {
pub server_endpoint: url::Url,
}
pub impl ServerConnection {
pub fn connect(&self) {
...