valorant_api 0.0.4

A library for interacting with the ingame Valorant-API.
Documentation
use serde::{Deserialize, Serialize};
use std::str::FromStr;

#[derive(Serialize, Deserialize, Debug, PartialEq, Eq, Hash, Clone, Copy)]
#[serde(rename_all = "lowercase")]
pub enum Queue {
    COMPETITIVE,
    DEATHMATCH,
    GGTEAM,
    NEWMAP,
    ONEFA,
    SEEDING,
    SPIKERUSH,
    SWIFTPLAY,
    TOURNAMENTMODE,
    UNRATED,
    SNOWBALL,
    PREMIER,
    HURM,
}

impl FromStr for Queue {
    type Err = ();

    fn from_str(input: &str) -> Result<Queue, Self::Err> {
        match input {
            "competitive" => Ok(Queue::COMPETITIVE),
            "deathmatch" => Ok(Queue::DEATHMATCH),
            "ggteam" => Ok(Queue::GGTEAM),
            "newmap" => Ok(Queue::NEWMAP),
            "onefa" => Ok(Queue::ONEFA),
            "seeding" => Ok(Queue::SEEDING),
            "spikerush" => Ok(Queue::SPIKERUSH),
            "swiftplay" => Ok(Queue::SWIFTPLAY),
            "tournamentmode" => Ok(Queue::TOURNAMENTMODE),
            "unrated" => Ok(Queue::UNRATED),
            "snowball" => Ok(Queue::SNOWBALL),
            "premier" => Ok(Queue::PREMIER),
            "hurm" => Ok(Queue::HURM),
            _ => Err(()),
        }
    }
}