feat: add packet_id() to Packet enum
This commit is contained in:
parent
506d07ed8d
commit
fc5cbdb361
2 changed files with 18 additions and 2 deletions
|
|
@ -21,6 +21,12 @@ pub enum Packet {
|
|||
}
|
||||
|
||||
impl Packet {
|
||||
pub fn packet_id(&self) -> Identifier {
|
||||
match self {
|
||||
Packet::V1 { packet_id, ..} => packet_id.clone()
|
||||
}
|
||||
}
|
||||
|
||||
/// Build packet **without** CRC32
|
||||
pub fn build_base_packet(&self) -> Vec<u8> {
|
||||
match self {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue