diff --git a/epp-client/src/client.rs b/epp-client/src/client.rs index d5cd239..9436819 100644 --- a/epp-client/src/client.rs +++ b/epp-client/src/client.rs @@ -58,7 +58,7 @@ use crate::login::Login; use crate::logout::Logout; use crate::registry::{epp_connect, EppConnection}; use crate::request::{generate_client_tr_id, EppExtension, EppRequest}; -use crate::response::{ResponseStatus, ResponseWithExtension}; +use crate::response::{Response, ResponseStatus}; use crate::xml::EppXml; /// Instances of the EppClient type are used to transact with the registry. @@ -143,7 +143,7 @@ impl EppClient { &mut self, request: T, id: &str, - ) -> Result>::Output, E::Response>, error::Error> + ) -> Result>::Output, E::Response>, error::Error> where T: EppRequest + Debug, E: EppExtension, @@ -179,7 +179,7 @@ impl EppClient { /// Sends the EPP Logout command to log out of the EPP session pub async fn logout( &mut self, - ) -> Result, NoExtension>, error::Error> { + ) -> Result, NoExtension>, error::Error> { let client_tr_id = generate_client_tr_id(&self.credentials.0).unwrap(); let epp_logout = Logout::::new(); diff --git a/epp-client/src/request.rs b/epp-client/src/request.rs index 48cac38..a89effe 100644 --- a/epp-client/src/request.rs +++ b/epp-client/src/request.rs @@ -8,7 +8,7 @@ use std::time::SystemTime; use crate::{ common::NoExtension, common::{ElementName, EppObject, Extension, StringValue}, - response::{ResponseStatus, ResponseWithExtension}, + response::{Response, ResponseStatus}, xml::EppXml, }; use epp_client_macros::ElementName; @@ -35,11 +35,8 @@ pub trait EppRequest: Sized + Debug { fn deserialize_response( epp_xml: &str, - ) -> Result, crate::error::Error> { - let rsp = - > as EppXml>::deserialize( - epp_xml, - )?; + ) -> Result, crate::error::Error> { + let rsp = > as EppXml>::deserialize(epp_xml)?; match rsp.data.result.code { 0..=2000 => Ok(rsp.data), _ => Err(crate::error::Error::EppCommandError(EppObject::build( diff --git a/epp-client/src/response.rs b/epp-client/src/response.rs index 0c3ef4f..0665df8 100644 --- a/epp-client/src/response.rs +++ b/epp-client/src/response.rs @@ -76,7 +76,7 @@ pub struct MessageQueue { #[element_name(name = "response")] /// Type corresponding to the <response> tag in an EPP response XML /// containing an <extension> tag -pub struct ResponseWithExtension { +pub struct Response { /// Data under the tag pub result: EppResult, /// Data under the tag @@ -104,7 +104,7 @@ pub struct ResponseStatus { pub tr_ids: ResponseTRID, } -impl ResponseWithExtension { +impl Response { /// Returns the data under the corresponding <resData> from the EPP XML pub fn res_data(&self) -> Option<&T> { match &self.res_data {