Module epp_client::connection::client[][src]

Expand description

Manages sending/receiving EppObject request and responses to the registry connection

Example

use epp_client::EppClient;
use epp_client::epp::{EppDomainCheck, EppDomainCheckResponse};
use epp_client::epp::generate_client_tr_id;

#[tokio::main]
async fn main() {
    // Create an instance of EppClient, specifying the name of the registry as in
    // the config file
    let mut client = match EppClient::new("verisign").await {
        Ok(client) => client,
        Err(e) => panic!("Failed to create EppClient: {}",  e)
    };

    // Make a EPP Hello call to the registry
    let greeting = client.hello().await.unwrap();
    println!("{:?}", greeting);

    // Execute an EPP Command against the registry with distinct request and response objects
    let domain_check = EppDomainCheck::new(vec!["eppdev.com", "eppdev.net"], generate_client_tr_id(&client).as_str());
    let response = client.transact::<_, EppDomainCheckResponse>(&domain_check).await.unwrap();
    println!("{:?}", response);
}

Structs

Instances of the EppClient type are used to transact with the registry. Once initialized, the EppClient instance can serialize EPP requests to XML and send them to the registry and deserialize the XML responses from the registry to local types

Functions

A function to generate a simple client TRID. Should only be used for testing, library users should generate a client TRID according to their own requirements