13 releases

0.2.5 Nov 29, 2020
0.2.4 Nov 28, 2020
0.1.6 Nov 26, 2020

#47 in #reqwest

38 downloads per month

MIT/Apache

78KB
2K SLoC

nanowrimo

crates.io Documentation MIT/Apache-2 licensed

An easy-to use NanoWrimo API client for Rust

  • Built on reqwest
  • Supports both anonymous and logged-in access

Example

This example uses Tokio

[dependencies]
nanowrimo = "0.2"
tokio = { version = "0.2", features = ["full"] }
use nanowrimo::{NanoClient};

#[tokio::main]
async fn main() {
    let client = NanoClient::new_user("username", env!("NANO_PASSWORD"))
        .await
        .expect("Couldn't create logged in NanoClient");
        
    let user = client.current_user()
        .await
        .expect("Couldn't get current user")
        .data;
        
    let data = &user.data;
        
    println!("User ID: {}", user.id())
    println!("User Bio: {}", data.bio);
    println!("Avatar: {}", data.avatar);
}

License

Licensed under either of

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~5–10MB
~184K SLoC