airmash_protocol/
client_packet.rs1use crate::client::*;
2
3#[derive(Clone, Debug)]
25#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26#[non_exhaustive]
27pub enum ClientPacket {
28 Login(Login),
29 Backup(Backup),
30 Horizon(Horizon),
31 Ack,
32 Pong(Pong),
33 Key(Key),
34 Command(Command),
35 ScoreDetailed,
36 Chat(Chat),
37 TeamChat(TeamChat),
38 Whisper(Whisper),
39 Say(Say),
40 VoteMute(VoteMute),
41 LocalPing(LocalPing),
42}
43
44macro_rules! impl_from_newtype {
45 ($type:tt) => {
46 impl_from_newtype_inner!(ClientPacket, $type);
47 };
48}
49
50macro_rules! impl_from_empty {
51 ($type:tt) => {
52 impl_from_empty_inner!(ClientPacket, $type);
53 };
54}
55
56impl_from_newtype!(Login);
57impl_from_newtype!(Backup);
58impl_from_newtype!(Horizon);
59impl_from_newtype!(Pong);
60impl_from_newtype!(Key);
61impl_from_newtype!(Command);
62impl_from_newtype!(Chat);
63impl_from_newtype!(TeamChat);
64impl_from_newtype!(Whisper);
65impl_from_newtype!(Say);
66impl_from_newtype!(VoteMute);
67impl_from_newtype!(LocalPing);
68
69impl_from_empty!(Ack);
70impl_from_empty!(ScoreDetailed);