Function minehut::player_distribution
source · [−]pub async fn player_distribution() -> Result<PlayerDistribution, Error>
Expand description
Gets a PlayerDistribution
struct from Minehut asynchronously. Gets the player
distribution for Java and Bedrock on Minehut.
Examples
#[tokio::main]
async fn main() {
// It is safe to assume this will not return an error.
// As such, we will unwrap() the result.
let dist = minehut::player_distribution().await.unwrap();
println!("{} java players", dist.java_total);
println!("{} bedrock servers", dist.bedrock_player_server);
}
Error
Returns a HTTP error if it cannot load page, this is usally a network error.