Crates.io | linode-rs |
lib.rs | linode-rs |
version | 0.1.3 |
source | src |
created_at | 2023-11-09 22:34:15.967357 |
updated_at | 2023-11-12 21:49:39.823256 |
description | A pure Rust Linode API binding. |
homepage | https://gitlab.com/deploy-robot/linode |
repository | https://gitlab.com/deploy-robot/linode |
max_upload_size | |
id | 1030496 |
size | 76,775 |
A pure Rust Linode API binding.
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(())
}
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(())
}