Function minehut::simple_stats
source · [−]pub async fn simple_stats() -> Result<SimpleStats, Error>
Expand description
Gets a SimpleStats
struct from Minehut asynchronously. Gets simple Minehut
statistics.
Examples
async fn print_stats() {
// It is safe to assume this will not return an error.
// As such we will unwrap() the result.
let stats = minehut::simple_stats().await.unwrap();
println!("{} players are on", stats.player_count);
println!("{} hosted servers", stats.server_count);
}
Error
Returns a HTTP error if it cannot load page, usually a network error.