pub async fn icon_from_id(id: &str) -> Option<ServerIcon>
Expand description

Gets a ServerIcon from the specified ID.

Arguments

  • id - ID of the icon.

Example

use minehut::servers::icons;
 
#[tokio::main]
async fn main() {
    // Get icon from ID
    let icon = icons::icon_from_id("some-weird-id").await;
 
    match icon {
        None => println!("Didn't find an icon"),
        Some(i) => println!("Found icon: {i:?}")
    }
}

Errors

Returns None if passed ID does not link to any server icons.