launchpadlib 0.1.9

Rust library for accessing Launchpad.net
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
fn main() {
    use launchpadlib::v1_0::Keytype::*;
    let client = reqwest::blocking::Client::new();
    let root = launchpadlib::v1_0::service_root(&client).unwrap();
    let people = root.people().unwrap();
    let person = people.get_by_email(&client, "jelmer@jelmer.uk").unwrap();
    let ssh_keys = person.sshkeys(&client).unwrap().map(|k| k.unwrap()).collect::<Vec<_>>();
    for key in ssh_keys {
        println!("{} {} {}", match key.keytype {
            RSA=> "ssh-rsa",
            DSA => "ssh-dss",
            ECDSA => "ecdsa-sha2-nistp256",
            ED25519 => "ssh-ed25519",
        }, key.keytext, key.comment.trim());
    }
}