Hydrus PTR Client

A rust http client for the hydrus PTR. Completeness is not guaranteed.

Usage

Fetching metadata and retrieving updates

```rust use hydrusptrclient::Client;

[tokio::main]

async fn main() { let client = Client::builder().acceptinvalidcerts(true).build().unwrap(); // list of all update files since id = 0 let metadata = client.getmetadata(0).await.unwrap(); let firstupdatefile = metadata.updatehashes().swapremove(0); let update = client.getupdate(firstupdatefile).await.unwrap(); println!("Got update {:?}", update); } ```

Streaming updates

```rust use hydrusptrclient::Client; use futures_util::StreamExt;

[tokio::main]

async fn main() { let client = Client::builder().acceptinvalidcerts(true).build().unwrap(); // streams all update since id = 0 let mut updatestream = client.streamupdates(0).await.unwrap();

while let Some(result) = update_stream.next().await {
    match result {
        Ok(update) => println!("We got an update {:?}", update),
        Err(e) => println!("Oh no, an error occurred {}", e),
    }
    break;
}

} ```

License

Apache-2.0