1pub mod have_file;
3
4pub mod i_have_code;
6
7pub mod ip_for_code;
9pub mod recieving_ip;
10pub mod you_have_file;
11
12pub enum ClientMsg {
13 HaveFile(have_file::HaveFile),
14 IHaveCode(i_have_code::IHaveCode),
15 HolePunch,
16 None,
17}
18
19pub enum ServerMsg {
20 YouHaveFile(you_have_file::YouHaveFile),
21 IpForCode(ip_for_code::IpForCode),
22 Recieving(recieving_ip::RecievingIp),
23}
24pub trait Message {
25 fn to_raw(&self) -> Vec<u8>;
26 fn from_raw(raw: &[u8]) -> Result<Self, &'static str>
27 where
28 Self: Sized;
29}
30
31