From 79c69dfd1f04bd0bcbc9bd2f79400f5c1e93a03c Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Mon, 13 Dec 2021 16:39:10 +0100 Subject: [PATCH] Privatize EppConnection type --- src/connection.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/connection.rs b/src/connection.rs index 83a8be8..baf9ffc 100644 --- a/src/connection.rs +++ b/src/connection.rs @@ -18,7 +18,7 @@ use crate::config::RegistryConfig; use crate::error; /// EPP Connection struct with some metadata for the connection -pub struct EppConnection { +pub(crate) struct EppConnection { registry: String, stream: TlsStream, pub greeting: String, @@ -26,7 +26,7 @@ pub struct EppConnection { impl EppConnection { /// Create an EppConnection instance with the stream to the registry - pub async fn connect( + pub(crate) async fn connect( registry: String, config: &RegistryConfig, ) -> Result> { @@ -99,7 +99,7 @@ impl EppConnection { /// Sends an EPP XML request to the registry and return the response /// receieved to the request - pub async fn transact(&mut self, content: &str) -> Result> { + pub(crate) async fn transact(&mut self, content: &str) -> Result> { debug!("{}: request: {}", self.registry, content); self.send_epp_request(content).await?; @@ -110,7 +110,7 @@ impl EppConnection { } /// Closes the socket and shuts the connection - pub async fn shutdown(&mut self) -> Result<(), Box> { + pub(crate) async fn shutdown(&mut self) -> Result<(), Box> { info!("{}: Closing connection", self.registry); self.stream.shutdown().await?;