| Crates.io | ip-allocator-client |
| lib.rs | ip-allocator-client |
| version | 0.2.1 |
| created_at | 2025-11-04 02:42:06.508793+00 |
| updated_at | 2025-11-07 04:58:20.593932+00 |
| description | Rust API client for ip-allocator-webserver |
| homepage | |
| repository | https://github.com/r33drichards/ip-allocator-webserver |
| max_upload_size | |
| id | 1915604 |
| size | 65,612 |
Rust API client for the IP Allocator webserver, auto-generated from the OpenAPI specification using progenitor.
Add this to your Cargo.toml:
[dependencies]
ip-allocator-client = "0.1"
use ip_allocator_client::Client;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Create a new client
let client = Client::new("http://localhost:8000")?;
// Borrow an item from the freelist
let result = client.handlers_ip_borrow().await?;
println!("Borrowed item: {:?}", result);
// Return an item
let return_result = client.handlers_ip_return_item(
&ip_allocator_client::types::ReturnInput {
item: serde_json::json!({"ip": "192.168.1.1"}),
}
).await?;
println!("Return operation: {:?}", return_result);
// Check operation status
let status = client.handlers_ip_get_operation_status(&return_result.operation_id).await?;
println!("Operation status: {:?}", status);
Ok(())
}
This SDK is auto-generated from the OpenAPI specification. To regenerate:
cargo run --release -- --print-openapi > openapi.jsoncd ip-allocator-client && cargo buildMIT