mirror of
https://codeberg.org/demostf/parser.git
synced 2026-11-30 10:40:50 +01:00
schemars
This commit is contained in:
parent
43b7270fcd
commit
93b51bff70
29 changed files with 15360 additions and 2187 deletions
|
|
@ -9,13 +9,8 @@ use serde::{Deserialize, Serialize};
|
|||
use std::cmp::min;
|
||||
use std::convert::TryFrom;
|
||||
use std::iter::once;
|
||||
#[cfg(feature = "wasm")]
|
||||
use wasm_bindgen::prelude::*;
|
||||
|
||||
#[cfg_attr(
|
||||
feature = "wasm",
|
||||
derive(wasm_typescript_definition::TypescriptDefinition)
|
||||
)]
|
||||
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
|
||||
#[derive(
|
||||
BitRead,
|
||||
BitWrite,
|
||||
|
|
@ -52,10 +47,7 @@ impl From<ClassId> for u16 {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg_attr(
|
||||
feature = "wasm",
|
||||
derive(wasm_typescript_definition::TypescriptDefinition)
|
||||
)]
|
||||
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
|
||||
#[derive(BitRead, BitWrite, PartialEq, Eq, Hash, Debug, Serialize, Deserialize, Clone, Display)]
|
||||
pub struct ServerClassName(String);
|
||||
|
||||
|
|
@ -77,10 +69,7 @@ impl From<&str> for ServerClassName {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg_attr(
|
||||
feature = "wasm",
|
||||
derive(wasm_typescript_definition::TypescriptDefinition)
|
||||
)]
|
||||
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
|
||||
#[derive(BitRead, BitWrite, Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
pub struct ServerClass {
|
||||
pub id: ClassId,
|
||||
|
|
@ -88,10 +77,7 @@ pub struct ServerClass {
|
|||
pub data_table: SendTableName,
|
||||
}
|
||||
|
||||
#[cfg_attr(
|
||||
feature = "wasm",
|
||||
derive(wasm_typescript_definition::TypescriptDefinition)
|
||||
)]
|
||||
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
|
||||
#[derive(
|
||||
BitRead,
|
||||
BitWrite,
|
||||
|
|
@ -127,10 +113,7 @@ impl From<&str> for SendTableName {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg_attr(
|
||||
feature = "wasm",
|
||||
derive(wasm_typescript_definition::TypescriptDefinition)
|
||||
)]
|
||||
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
pub struct ParseSendTable {
|
||||
pub name: SendTableName,
|
||||
|
|
@ -353,10 +336,7 @@ impl ParseSendTable {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg_attr(
|
||||
feature = "wasm",
|
||||
derive(wasm_typescript_definition::TypescriptDefinition)
|
||||
)]
|
||||
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct SendTable {
|
||||
pub name: SendTableName,
|
||||
|
|
@ -365,10 +345,7 @@ pub struct SendTable {
|
|||
pub flattened_props: Vec<SendPropDefinition>,
|
||||
}
|
||||
|
||||
#[cfg_attr(
|
||||
feature = "wasm",
|
||||
derive(wasm_typescript_definition::TypescriptDefinition)
|
||||
)]
|
||||
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
|
||||
#[derive(Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct DataTablePacket {
|
||||
pub tick: u32,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue