diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/client.rs | 16 | ||||
-rw-r--r-- | src/server.rs | 15 |
2 files changed, 31 insertions, 0 deletions
diff --git a/src/client.rs b/src/client.rs index 8d4ea8e..81db8d8 100644 --- a/src/client.rs +++ b/src/client.rs @@ -27,6 +27,22 @@ pub struct ClientConfigurationData { local_bind_port: u16, } +impl ClientConfigurationData { + pub fn new( + server_host: String, + server_port: u16, + local_bind_host: String, + local_bind_port: u16, + ) -> Self { + Self { + server_host, + server_port, + local_bind_host, + local_bind_port, + } + } +} + #[derive(Debug, PartialEq, Eq)] enum ClientState { Connecting, diff --git a/src/server.rs b/src/server.rs index 3bd58ef..a250f98 100644 --- a/src/server.rs +++ b/src/server.rs @@ -49,6 +49,21 @@ pub struct ServerConfigurationData { local_bind_host: String, } +impl ServerConfigurationData { + pub fn new( + host: String, + port: u16, + local_bind_host: String, + ) -> Self { + Self { + host, + port, + local_bind_host, + } + } +} + + #[derive(Debug)] pub struct ClientPayload { client_id: ClientId, |