4 releases

0.1.3 Nov 12, 2023
0.1.2 Nov 10, 2023
0.1.1 Nov 9, 2023
0.1.0 Nov 9, 2023

#1077 in Development tools

Download history 15/week @ 2024-06-13 20/week @ 2024-06-20 17/week @ 2024-06-27 34/week @ 2024-07-04 70/week @ 2024-07-11 21/week @ 2024-07-18 66/week @ 2024-07-25 18/week @ 2024-08-01 13/week @ 2024-08-08 13/week @ 2024-08-15 7/week @ 2024-08-22 9/week @ 2024-08-29 11/week @ 2024-09-05 19/week @ 2024-09-12 94/week @ 2024-09-19 47/week @ 2024-09-26

172 downloads per month

MIT license

34KB
769 lines

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

Dependencies

~4–18MB
~304K SLoC