aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorregenerativep <regeneralp@gmail.com>2021-10-27 20:02:14 -0400
committerregenerativep <regeneralp@gmail.com>2021-10-27 20:02:14 -0400
commitc281cd184990eafd62eea57a740ce7397b3fc4d9 (patch)
tree3f4e3f002c5d227d74c1579495742495d91cfcc4
parent563d176b597215d9dd5f939a6a15b697d9888935 (diff)
downloadmcproto-rs-c281cd184990eafd62eea57a740ce7397b3fc4d9.tar.gz
mcproto-rs-c281cd184990eafd62eea57a740ce7397b3fc4d9.tar.bz2
mcproto-rs-c281cd184990eafd62eea57a740ce7397b3fc4d9.zip
packeterr cloneable
-rw-r--r--src/deserialize.rs1
-rw-r--r--src/protocol.rs3
2 files changed, 3 insertions, 1 deletions
diff --git a/src/deserialize.rs b/src/deserialize.rs
index dd9a845..974dc30 100644
--- a/src/deserialize.rs
+++ b/src/deserialize.rs
@@ -1,6 +1,7 @@
use crate::types::VarInt;
use alloc::{vec::Vec, string::{FromUtf8Error, String}, fmt};
+#[derive(Clone)]
pub enum DeserializeErr {
Eof,
VarNumTooLong(Vec<u8>),
diff --git a/src/protocol.rs b/src/protocol.rs
index f8873a1..0b3e4c1 100644
--- a/src/protocol.rs
+++ b/src/protocol.rs
@@ -129,6 +129,7 @@ pub trait RawPacket<'a>: HasPacketId + Sized {
pub trait Packet: HasPacketId + HasPacketBody + Sized {}
+#[derive(Clone)]
pub enum PacketErr {
UnknownId(Id),
DeserializeFailed(DeserializeErr),
@@ -729,4 +730,4 @@ macro_rules! proto_byte_flag {
}
}
}
-} \ No newline at end of file
+}