3 releases

0.1.2 Jan 13, 2024
0.1.1 Jan 13, 2023
0.1.0 Oct 31, 2022

#1102 in Web programming

Download history 149/week @ 2024-01-07 55/week @ 2024-01-14 148/week @ 2024-02-04 4/week @ 2024-02-18 32/week @ 2024-02-25 2/week @ 2024-03-03 52/week @ 2024-03-31 1/week @ 2024-04-07

53 downloads per month

MIT/Apache

91KB
2K SLoC

Rust lava api crate

This crate provides access to the LAVA REST API


lib.rs:

Provide access to the data held by a LAVA server via the data export REST interface.

Overview

The central object in this crate is a Lava, which represents a local proxy for a LAVA server. The coverage of the data exposed by LAVA is not complete. It is however possible to readback

  • jobs
  • test results
  • devices
  • workers
  • tags (which apply to both jobs and devices)

Pagination is handled transparently, but you will likely want to use TryStreamExt to iterate over returned streams of objects, since this crate is async and built on the tokio runtime.

Example:

use futures::stream::TryStreamExt;
use lava_api::Lava;
#

let lava = Lava::new(&service_uri, lava_token).expect("failed to create Lava object");

// Read back the device data from the server
let mut ld = lava.devices();
while let Some(device) = ld
    .try_next()
    .await
    .expect("failed to read devices from server")
{
    println!("Got device {:?}", device);
}

Dependencies

~9–24MB
~351K SLoC