Crates.io | vultr |
lib.rs | vultr |
version | 0.3.3 |
source | src |
created_at | 2020-12-31 21:47:05.932678 |
updated_at | 2023-11-16 20:09:18.214109 |
description | A pure Rust Vultr API binding. |
homepage | https://gitlab.com/deploy-robot/vultr |
repository | https://gitlab.com/deploy-robot/vultr |
max_upload_size | |
id | 329874 |
size | 90,716 |
A pure Rust Vultr API binding.
It needs to have the feature "blocking" enabled.
vultr = { version = "*", features = ["blocking"] }
use vultr::VultrApi;
use vultr::VultrError;
fn main() -> Result<(), VultrError> {
let api = VultrApi::new("<KEY>");
let account = api.get_account_info()?;
println!("ACCOUNT: {:?}", account);
let regions = api.get_regions()?;
println!("REGIONS: {:?}", regions);
let plans = api.get_plans()?;
println!("PLANS: {:?}", plans);
let os = api.get_os_list()?;
println!("OS: {:?}", os);
Ok(())
}
vultr = { version = "*" }
use vultr::VultrApi;
use vultr::VultrError;
#[async_std::main]
async fn main() -> Result<(), VultrError> {
let api = VultrApi::new("<KEY>");
let account = api.get_account_info_async().await?;
println!("ACCOUNT: {:?}", account);
Ok(())
}