diff --git a/epp-client/src/config.rs b/epp-client/src/config.rs index 7db8059..197c568 100644 --- a/epp-client/src/config.rs +++ b/epp-client/src/config.rs @@ -57,6 +57,19 @@ pub struct EppClientTlsFiles { pub key: String, } +/// Config that stores settings for multiple registries +#[derive(Serialize, Deserialize, Debug)] +pub struct EppClientConfig { + pub registry: HashMap, +} + +impl EppClientConfig { + /// Returns the config for a particular registry + pub fn registry(&self, registry: &str) -> Option<&EppClientConnection> { + self.registry.get(registry) + } +} + /// Connection details to connect to and authenticate with a registry #[derive(Serialize, Deserialize, Debug)] pub struct EppClientConnection { @@ -68,12 +81,6 @@ pub struct EppClientConnection { pub tls_files: Option, } -/// Config that stores settings for multiple registries -#[derive(Serialize, Deserialize, Debug)] -pub struct EppClientConfig { - pub registry: HashMap, -} - impl EppClientConnection { /// Returns the EPP host and port no as a tuple pub fn connection_details(&self) -> (String, u16) { @@ -136,10 +143,3 @@ impl EppClientConnection { Err(Error::Other("No private key found in PEM file".to_owned())) } } - -impl EppClientConfig { - /// Returns the config for a particular registry - pub fn registry(&self, registry: &str) -> Option<&EppClientConnection> { - self.registry.get(registry) - } -}