masterstat

Crates.iomasterstat
lib.rsmasterstat
version0.1.3
sourcesrc
created_at2024-04-25 15:33:57.787306
updated_at2024-05-04 11:07:16.213942
descriptionGet server addresses from QuakeWorld master servers.
homepage
repositoryhttps://github.com/vikpe/masterstat-rust
max_upload_size
id1220409
size11,436
Viktor Persson (vikpe)

documentation

README

masterstat Test crates docs.rs

Get server addresses from QuakeWorld master servers.

Installation

cargo add masterstat

Usage

Get server addresses from a single master server

use std::time::Duration;

let master = "master.quakeworld.nu:27000";
let timeout = Some(Duration::from_secs(2));

match masterstat::server_addresses(&master, timeout) {
    Ok(addresses) => { println!("found {} server addresses", addresses.len()) },
    Err(e) => { eprintln!("error: {}", e); }
}

Get server addresses from multiple master servers (async, in parallel)

use std::time::Duration;

async fn test() {
  let masters = ["master.quakeworld.nu:27000", "master.quakeservers.net:27000"];
  let timeout = Some(Duration::from_secs(2));
  let server_addresses = masterstat::server_addresses_from_many(&masters, timeout).await?;
}

See also

Commit count: 25

cargo fmt