mirror of
https://github.com/MingweiSamuel/Riven.git
synced 2024-12-26 19:06:32 +00:00
making some enums
#[non_exhaustive]
This commit is contained in:
parent
15faf83241
commit
9db4c1a4a5
12 changed files with 16 additions and 1 deletions
|
@ -14,6 +14,7 @@ use serde_repr::{ Serialize_repr, Deserialize_repr };
|
|||
///
|
||||
/// The documentation of each variant specifies:<br>
|
||||
/// NAME (`IDENTIFIER`, ID).
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
#[derive(IntoPrimitive, TryFromPrimitive)]
|
||||
#[derive(Serialize_repr, Deserialize_repr)]
|
||||
|
@ -120,6 +121,7 @@ pub enum Champion {
|
|||
/** Rumble (`Rumble`, 68). */ Rumble = 68,
|
||||
/** Ryze (`Ryze`, 13). */ Ryze = 13,
|
||||
/** Sejuani (`Sejuani`, 113). */ Sejuani = 113,
|
||||
/** Senna (`Senna`, 235). */ Senna = 235,
|
||||
/** Shaco (`Shaco`, 35). */ Shaco = 35,
|
||||
/** Shen (`Shen`, 98). */ Shen = 98,
|
||||
/** Shyvana (`Shyvana`, 102). */ Shyvana = 102,
|
||||
|
@ -271,6 +273,7 @@ impl Champion {
|
|||
Self::Rumble => "Rumble",
|
||||
Self::Ryze => "Ryze",
|
||||
Self::Sejuani => "Sejuani",
|
||||
Self::Senna => "Senna",
|
||||
Self::Shaco => "Shaco",
|
||||
Self::Shen => "Shen",
|
||||
Self::Shyvana => "Shyvana",
|
||||
|
@ -422,6 +425,7 @@ impl Champion {
|
|||
Self::Rumble => "Rumble",
|
||||
Self::Ryze => "Ryze",
|
||||
Self::Sejuani => "Sejuani",
|
||||
Self::Senna => "Senna",
|
||||
Self::Shaco => "Shaco",
|
||||
Self::Shen => "Shen",
|
||||
Self::Shyvana => "Shyvana",
|
||||
|
@ -589,6 +593,7 @@ impl std::str::FromStr for Champion {
|
|||
1381322050 /* RUMB */ => Ok(Self::Rumble),
|
||||
1381587525 /* RYZE */ => Ok(Self::Ryze),
|
||||
1397049941 /* SEJU */ => Ok(Self::Sejuani),
|
||||
1397050958 /* SENN */ => Ok(Self::Senna),
|
||||
1397244227 /* SHAC */ => Ok(Self::Shaco),
|
||||
1397245262 /* SHEN */ => Ok(Self::Shen),
|
||||
1397250390 /* SHYV */ => Ok(Self::Shyvana),
|
||||
|
|
|
@ -10,6 +10,7 @@ use strum_macros::{ EnumString, Display, AsRefStr };
|
|||
|
||||
/// League of Legends game mode, such as Classic,
|
||||
/// ARAM, URF, One For All, Ascension, etc.
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
#[derive(Eq, PartialEq, Hash)]
|
||||
#[derive(EnumString, Display, AsRefStr)]
|
||||
|
|
|
@ -10,6 +10,7 @@ use serde_repr::{ Serialize_repr, Deserialize_repr };
|
|||
use num_enum::{ IntoPrimitive, TryFromPrimitive };
|
||||
|
||||
/// League of Legends maps.
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
#[derive(Eq, PartialEq, Hash, PartialOrd, Ord)]
|
||||
#[derive(Serialize_repr, Deserialize_repr)]
|
||||
|
|
|
@ -10,6 +10,7 @@ use serde_repr::{ Serialize_repr, Deserialize_repr };
|
|||
use num_enum::{ IntoPrimitive, TryFromPrimitive };
|
||||
|
||||
/// League of Legends matchmaking queue.
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
#[derive(Eq, PartialEq)]
|
||||
#[derive(Serialize_repr, Deserialize_repr)]
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
use strum_macros::{ EnumString, Display, AsRefStr };
|
||||
|
||||
/// LoL or TFT ranked queue types.
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
#[derive(Eq, PartialEq, Hash)]
|
||||
#[derive(EnumString, Display, AsRefStr)]
|
||||
|
|
|
@ -10,6 +10,7 @@ use serde_repr::{ Serialize_repr, Deserialize_repr };
|
|||
use num_enum::{ IntoPrimitive, TryFromPrimitive };
|
||||
|
||||
/// League of Legends matchmaking seasons.
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
#[derive(Eq, PartialEq, Hash, PartialOrd, Ord)]
|
||||
#[derive(Serialize_repr, Deserialize_repr)]
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
///////////////////////////////////////////////
|
||||
|
||||
// http://www.mingweisamuel.com/riotapi-schema/tool/
|
||||
// Version 85da12632b552f2033d1708c17b04306e90b935e
|
||||
// Version 6699beea97d4afea8ffa9310a554ec23a499e531
|
||||
|
||||
//! Automatically generated endpoint handles and data transfer structs.
|
||||
|
||||
|
|
|
@ -21,6 +21,7 @@ use serde_repr::{ Serialize_repr, Deserialize_repr };
|
|||
///
|
||||
/// The documentation of each variant specifies:<br>
|
||||
/// NAME (`IDENTIFIER`, ID).
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
#[derive(IntoPrimitive, TryFromPrimitive)]
|
||||
#[derive(Serialize_repr, Deserialize_repr)]
|
||||
|
|
|
@ -7,6 +7,7 @@ use strum_macros::{ EnumString, Display, AsRefStr };
|
|||
|
||||
/// League of Legends game mode, such as Classic,
|
||||
/// ARAM, URF, One For All, Ascension, etc.
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
#[derive(Eq, PartialEq, Hash)]
|
||||
#[derive(EnumString, Display, AsRefStr)]
|
||||
|
|
|
@ -9,6 +9,7 @@ use serde_repr::{ Serialize_repr, Deserialize_repr };
|
|||
use num_enum::{ IntoPrimitive, TryFromPrimitive };
|
||||
|
||||
/// League of Legends maps.
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
#[derive(Eq, PartialEq, Hash, PartialOrd, Ord)]
|
||||
#[derive(Serialize_repr, Deserialize_repr)]
|
||||
|
|
|
@ -13,6 +13,7 @@ use serde_repr::{ Serialize_repr, Deserialize_repr };
|
|||
use num_enum::{ IntoPrimitive, TryFromPrimitive };
|
||||
|
||||
/// League of Legends matchmaking queue.
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
#[derive(Eq, PartialEq)]
|
||||
#[derive(Serialize_repr, Deserialize_repr)]
|
||||
|
|
|
@ -7,6 +7,7 @@ use serde_repr::{ Serialize_repr, Deserialize_repr };
|
|||
use num_enum::{ IntoPrimitive, TryFromPrimitive };
|
||||
|
||||
/// League of Legends matchmaking seasons.
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
#[derive(Eq, PartialEq, Hash, PartialOrd, Ord)]
|
||||
#[derive(Serialize_repr, Deserialize_repr)]
|
||||
|
|
Loading…
Reference in a new issue