pub enum PacketKind {
Empty,
MetaData,
MetaDataEnd,
Content,
End,
Unit,
Unknown,
}
Expand description
Determines kind of Packet.
Variants§
Empty
Empty packet usually used only for testing or like a placeholder.
MetaData
Part of metadata
.
MetaDataEnd
Same as MetaData, only marking end of it.
Content
Content packet.
End
Used to signalize end of the [message
].
Can be TcpMessage or an end in general (of all times and you know it).
Unit
Usually used in udp context for signaling that given Packet
is the whole message
.
Unknown
Used in case if PacketKind is not recognized.
Trait Implementations§
Source§impl Clone for PacketKind
impl Clone for PacketKind
Source§fn clone(&self) -> PacketKind
fn clone(&self) -> PacketKind
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for PacketKind
impl Debug for PacketKind
Source§impl<'de> Deserialize<'de> for PacketKind
impl<'de> Deserialize<'de> for PacketKind
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<PacketKind> for Bytes
impl From<PacketKind> for Bytes
Source§fn from(value: PacketKind) -> Self
fn from(value: PacketKind) -> Self
Converts to this type from the input type.
Source§impl FromRon<'_> for PacketKind
impl FromRon<'_> for PacketKind
Source§impl PartialEq for PacketKind
impl PartialEq for PacketKind
Source§impl Serialize for PacketKind
impl Serialize for PacketKind
Source§impl ToRon for PacketKind
impl ToRon for PacketKind
Source§impl TryFrom<&[u8]> for PacketKind
impl TryFrom<&[u8]> for PacketKind
Source§impl TryFrom<Bytes> for PacketKind
impl TryFrom<Bytes> for PacketKind
impl StructuralPartialEq for PacketKind
Auto Trait Implementations§
impl Freeze for PacketKind
impl RefUnwindSafe for PacketKind
impl Send for PacketKind
impl Sync for PacketKind
impl Unpin for PacketKind
impl UnwindSafe for PacketKind
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more