pub async fn icon_from_name(name: &str) -> Option<ServerIcon>
Expand description
Gets an icon from the name specified asynchronously.
Arguments
name
- Name of the icon.
Example
use minehut::servers::icons;
#[tokio::main]
async fn main() {
let icon = icons::icon_from_name("IRON_BOOTS").await;
match icon {
None => println!("Didn't find an icon"),
Some(i) => println!("Found icon: {i:?}")
}
}
Errors
Returns None
only if the name given does not match to a server icon.