Expand description
§Hetzner Cloud Client
A comprehensive, async Hetzner Cloud API client with builders, validation, and extensive error handling.
§Features
- Type-safe builders with compile-time validation
- Comprehensive error handling with detailed error contexts
- Async/await support with Tokio
- Input validation for IP addresses, ports, names, etc.
- Full API coverage for servers, networks, firewalls, load balancers, and SSH keys
§Quick Start
use lmrc_hetzner::HetznerClient;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Create a client from environment variable
let client = HetznerClient::from_env()?;
// Or build with custom configuration
let client = HetznerClient::builder()
.api_token("your-api-token".to_string())
.build()?;
Ok(())
}Re-exports§
pub use adapter::HetznerAdapter;pub use client::HetznerClient;pub use client::HetznerClientBuilder;pub use config::NetworkConfig;pub use differ::HetznerDiffer;pub use firewalls::FirewallManager;pub use floating_ips::FloatingIpManager;pub use loadbalancers::LoadBalancerManager;pub use networks::NetworkManager;pub use provisioner::HetznerProvisioner;pub use servers::ServerManager;pub use ssh_keys::SshKeyManager;pub use state::StateManager;pub use volumes::VolumeManager;
Modules§
- adapter
- Hetzner Cloud Adapter
- client
- config
- Configuration structures for Hetzner Cloud resources with builder patterns.
- differ
- Hetzner Cloud infrastructure differ
- domain
- Domain entities for infrastructure management
- firewalls
- floating_
ips - Floating IP management for Hetzner Cloud
- loadbalancers
- networks
- ports
- Port traits for infrastructure management
- provisioner
- Hetzner Cloud infrastructure provisioner
- retry
- Retry logic with exponential backoff
- servers
- ssh_
keys - state
- State persistence for infrastructure management
- validation
- Input validation utilities for Hetzner Cloud resources.
- volumes
- Volume management for Hetzner Cloud
Structs§
- Action
- Action resource (for async operations)
- Action
Error - Algorithm
- ApiError
- Error response from Hetzner API
- ApiResponse
- Common response wrapper from Hetzner API
- Datacenter
- Error
Details - Firewall
- Firewall resource
- Firewall
Applied To - Firewall
Rule - Firewall
Server Ref - Health
Check - Http
Config - Http
Health Check - Image
- IpInfo
- LbPrivate
Net - LbPublic
Net - LbService
- LbTarget
- LbTarget
Server - Load
Balancer - Load Balancer resource
- Load
Balancer Type - Location
- Network
- Network resource
- Private
Net - Public
Net - Server
- Server resource
- Server
Type - SshKey
- SSH Key resource
- Subnet
Enums§
- Hetzner
Error - Comprehensive error type for Hetzner Cloud API operations.
Type Aliases§
- Result
- Result type alias for operations that may return a
HetznerError.