pub struct Packet {
pub protocol_id: u32,
pub sender_peer_id: PeerId,
pub channel: u8,
pub body: PacketBody,
}
Fields§
§protocol_id: u32
§sender_peer_id: PeerId
§channel: u8
§body: PacketBody
Implementations§
Source§impl Packet
impl Packet
pub fn new(sender_peer_id: PeerId, channel: u8, body: PacketBody) -> Self
pub fn inner(&self) -> &InnerBody
pub fn as_reliable(&self) -> Option<&ReliableBody>
pub fn as_control(&self) -> Option<&ControlBody>
Trait Implementations§
Source§impl Deserialize for Packet
impl Deserialize for Packet
fn deserialize(deser: &mut Deserializer<'_>) -> DeserializeResult<Self>
impl StructuralPartialEq for Packet
Auto Trait Implementations§
impl Freeze for Packet
impl RefUnwindSafe for Packet
impl Send for Packet
impl Sync for Packet
impl Unpin for Packet
impl UnwindSafe for Packet
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