pub async fn of_rarity(rarity: Rarity) -> Result<Vec<ServerIcon>, Error>
Expand description

Returns all ServerIcons that match a specific rarity.

Arguments

  • rarity - Rarity to filter icons with.

Example

use minehut::servers::icons;
use minehut::models::ServerIcon;
 
async fn common_icons() -> Vec<ServerIcon> {
    // Getting all icons of rarity Common
    icons::of_rarity(icons::Rarity::Common).await.unwrap() 
}

Errors

Returns an error if Reqwest cannot read data from page. Usually a network issue.