mirror of
https://github.com/tribufu/rust-gamedig
synced 2026-06-01 09:42:41 +00:00
[Crate] Add feature: serde (#21)
* feat(serde): add additional derives * fix: remove attr on internal enum * fix add missing derive
This commit is contained in:
parent
bd2e373d66
commit
84af4230f7
5 changed files with 113 additions and 62 deletions
|
|
@ -3,7 +3,11 @@ use crate::GDResult;
|
|||
use crate::protocols::valve;
|
||||
use crate::protocols::valve::{Server, ServerPlayer, get_optional_extracted_data, SteamApp};
|
||||
|
||||
#[derive(Debug)]
|
||||
#[cfg (feature = "serde")]
|
||||
use serde::{Serialize, Deserialize};
|
||||
|
||||
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
|
||||
#[derive(Debug, Clone, PartialEq, PartialOrd)]
|
||||
pub struct TheShipPlayer {
|
||||
pub name: String,
|
||||
pub score: u32,
|
||||
|
|
@ -24,7 +28,8 @@ impl TheShipPlayer {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
pub struct Response {
|
||||
pub protocol: u8,
|
||||
pub name: String,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue