strecken_info

Module revision

Source
Expand description

Revisions are like versions of disruptions. To get the disruptions you need a revision.

use strecken_info::revision::get_revision;

#[tokio::main]
async fn main() {
    let revision: u32 = get_revision().await.unwrap();
}

If you want to wait for a new revision try this:

use strecken_info::revision::RevisionContext;

#[tokio::main]
async fn main() {
    let mut ctx = RevisionContext::connect().await.unwrap();
    let first_revision: u32 = ctx.get_first_revision().await.unwrap();
    println!("First revision: {first_revision}");
    loop {
        let revision = ctx.wait_for_new_revision().await.unwrap();
        println!("Got new revision: {revision}");
    }
}

Structs§

Functions§