Crates.io | digitalocean-rs |
lib.rs | digitalocean-rs |
version | 0.1.9 |
source | src |
created_at | 2023-11-05 00:03:45.269279 |
updated_at | 2023-11-06 20:11:01.104823 |
description | A pure Rust digitalocean API binding. |
homepage | https://gitlab.com/deploy-robot/digitalocean |
repository | https://gitlab.com/deploy-robot/digitalocean |
max_upload_size | |
id | 1025648 |
size | 72,730 |
A pure Rust DigitalOcean API binding.
It needs to have the feature "blocking" enabled.
digitalocean-rs = { version = "*", features = ["blocking"] }
use digitalocean_rs::DigitalOceanApi;
use digitalocean_rs::DigitalOceanError;
fn main() -> Result<(), DigitalOceanError> {
let api = DigitalOceanApi::new("api key");
let images = api.list_images()?;
println!("IMAGES: {:#?}", images);
let sizes = api.list_sizes()?;
println!("SIZES: {:#?}", sizes);
Ok(())
}
digitalocean-rs = { version = "*" }
use digitalocean_rs::DigitalOceanApi;
use digitalocean_rs::DigitalOceanError;
#[async_std::main]
async fn main() -> Result<(), DigitalOceanError> {
let api = DigitalOceanApi::new("api key");
let images = api.list_images_async().await?;
println!("IMAGES: {:#?}", images);
let sizes = api.list_sizes_async().await?;
println!("SIZES: {:#?}", sizes);
Ok(())
}