vultr

Crates.iovultr
lib.rsvultr
version0.3.3
sourcesrc
created_at2020-12-31 21:47:05.932678
updated_at2023-11-16 20:09:18.214109
descriptionA pure Rust Vultr API binding.
homepagehttps://gitlab.com/deploy-robot/vultr
repositoryhttps://gitlab.com/deploy-robot/vultr
max_upload_size
id329874
size90,716
Alex (segler-alex)

documentation

https://docs.rs/crate/vultr/

README

vultr-api-rust

A pure Rust Vultr API binding.

Examples

Example blocking

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(())
}

Example async

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(())
}

Features

  • "default" - use nativetls
  • "default-rustls" - use rusttls
  • "blocking" - enable blocking api
  • "rustls" - enable rustls for reqwest
  • "nativetls" - add support for nativetls DEFAULT
  • "gzip" - enable gzip in reqwest
  • "brotli" - enable brotli in reqwest
  • "deflate" - enable deflate in reqwest

TODO

  • Documentation
  • Full api support
Commit count: 17

cargo fmt