Modules in Rust
A [[module]] is a collection of methods, it is defined by a keyword mod
.
mod client {
fn connect() {}
}
mod network {
fn connect() {}
mod server {
fn connect() {}
}
}
You can also move the modules into separate files:
mod client;
and client.rs:
fn connect() {}