linode-rs

Crates.iolinode-rs
lib.rslinode-rs
version0.1.3
sourcesrc
created_at2023-11-09 22:34:15.967357
updated_at2023-11-12 21:49:39.823256
descriptionA pure Rust Linode API binding.
homepagehttps://gitlab.com/deploy-robot/linode
repositoryhttps://gitlab.com/deploy-robot/linode
max_upload_size
id1030496
size76,775
Alex (segler-alex)

documentation

https://docs.rs/crate/linode-rs/

README

linode

A pure Rust Linode API binding.

Examples

Example blocking

It needs to have the feature "blocking" enabled.

linode-rs = { version = "*", features = ["blocking"] }
use linode_rs::LinodeApi;
use linode_rs::LinodeError;

fn main() -> Result<(), LinodeError> {
    let api = LinodeApi::new("<KEY>");
    let list = api.list_os()?;
    println!("OS {:#?}", list);

    let list = api.list_types()?;
    println!("TYPES {:#?}", list);

    let list = api.list_instances()?;
    println!("INSTANCES {:#?}", list);
    Ok(())
}

Example async

linode-rs = { version = "*" }
use linode_rs::LinodeApi;
use linode_rs::LinodeError;

#[async_std::main]
async fn main() -> Result<(), LinodeError> {
    let api = LinodeApi::new("<KEY>");
    let list = api.list_os_async().await?;
    println!("OS {:#?}", list);

    let list = api.list_types_async().await?;
    println!("TYPES {:#?}", list);

    let list = api.list_instances_async().await?;
    println!("INSTANCES {:#?}", list);
    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: 14

cargo fmt