Skip to main content

Crate pdns_client

Crate pdns_client 

Source
Expand description

§pdns_client

This library crate provides a blocking/synchronous client for interacting with the PowerDNS Authoritative Server API.

§Examples

fn main() -> Result<(), Box<dyn std::error::Error>>{
    let client = pdns_client::Client::new("http://127.0.0.1:8081", "api_key")?;
    let servers = client.list_servers()?;

    for server in servers {
        println!(
            "pdns server with id={}, daemon_type={}",
            server.id, server.daemon_type
        );
    }

    Ok(())
}

Modules§

error
The Err type

Structs§

Client
The pdns api client for a single pdns webserver. It should be created with the Client::new or Client::new_with_client function.
Server
The server information returned by pdns API. Note, crucially, this does not contain any information about the client (and thus the pdns webserver) used to retrieve this information. As a result, users may want to ensure that servers being compared, are retrieved from the same client/pdns webserver.

Enums§

Error
The error type. This is an enum describing all possible errors returnable. Unless otherwise specified, assume that a public/exported function returning this enum can return any of its variants.

Type Aliases§

Result
Result is the alias Result type