1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
pub struct Config {
    port: Port,
    ip: Ip
}

type Port = i32;
type Ip = String;


impl Default for Config {
    fn default() -> Self {
        Self { port: 7878, ip: "127.0.0.1".to_string() }
    }
}

impl Config {
    pub fn adresse(&self) -> String {
        format!("{}:{}", self.ip, self.port)
    }
}