#launchpad #api #api-bindings #rust

bin+lib launchpadlib

Rust library for accessing Launchpad.net

7 releases

0.2.0 Apr 1, 2024
0.1.9 Mar 29, 2024
0.1.8 Dec 22, 2023
0.1.1 Oct 27, 2023

#1078 in Network programming

Download history 63/week @ 2023-12-22 5/week @ 2024-01-19 4/week @ 2024-01-26 5/week @ 2024-02-23 4/week @ 2024-03-01 12/week @ 2024-03-08 5/week @ 2024-03-15 4/week @ 2024-03-22 327/week @ 2024-03-29 65/week @ 2024-04-05

411 downloads per month
Used in disperse

Apache-2.0 and maybe GPL-3.0+

470KB
1.5K SLoC

Rust bindings for the Launchpad API

Example:

use launchpadlib::Resource;
use launchpadlib::v1_0::ServiceRoot;

fn main() {
    use url::Url;

    let client = launchpadlib::Client::anonymous("just+testing");
    let service_root = launchpadlib::v1_0::service_root(&client).unwrap();
    let people = service_root.people().unwrap();
    let person = people.get_by_email(&client, "jelmer@jelmer.uk").unwrap();
    let ssh_keys = person.sshkeys(&client).unwrap().map(|k| k.keytext).collect::<Vec<_>>();
    println!("SSH Keys: {:?}", ssh_keys);
}

Bindings are generated from the wadl published by Launchpad.

Limitations and bugs

  • There is only a blocking API available at the moment

  • While bindings are generated from the entire WADL file, I have only used a small number of them. Please report bugs if you run into issues.

  • Launchpad's WADL is incorrect in places, e.g. claiming that certain fields are optional while they will actually be set to null. Any problems with the WADL will impact the usability of the rust bindings.

    See fixup.xsl for manual patches that are applied; this file is almost certainly incomplete.

Dependencies

~9–24MB
~346K SLoC