valorant_api_official 0.2.2

A library for interacting with the Official Valorant API.
Documentation
use std::str::FromStr;

use serde::{Deserialize, Serialize};

#[derive(PartialEq, Eq, Hash, Serialize, Deserialize, Debug, Clone, Copy)]
pub enum Site {
    A,
    B,
    C,
}

impl FromStr for Site {
    type Err = String;
    fn from_str(s: &str) -> Result<Self, Self::Err> {
        match s {
            "A" => Ok(Site::A),
            "B" => Ok(Site::B),
            "C" => Ok(Site::C),
            _ => Err(format!("{s} is not a valid site")),
        }
    }
}