proto_packet/packet/packet.rs
1use crate::io::WireType;
2use enc::{DecodeFromRead, DecodeFromReadPrefix, EncodeToSlice, EncodeToWrite, EncodedLen};
3use std::fmt::Debug;
4use std::hash::Hash;
5
6/// A packet.
7pub trait Packet:
8 'static
9 + Clone
10 + Ord
11 + PartialOrd
12 + Eq
13 + PartialEq
14 + Hash
15 + Debug
16 + Sync
17 + Send
18 + EncodedLen
19 + EncodeToSlice
20 + EncodeToWrite
21 + DecodeFromRead
22 + DecodeFromReadPrefix
23{
24 /// Gets the wire type.
25 fn wire() -> WireType;
26}