pub struct OutPacket { /* private fields */ }Implementations§
Source§impl OutPacket
impl OutPacket
pub fn new( mac: [u8; 8], packet_id: u16, client_id: Option<u16>, flags: Flags, packet_type: PacketType, ) -> Self
Sourcepub fn new_with_dir(
dir: Direction,
flags: Flags,
packet_type: PacketType,
) -> Self
pub fn new_with_dir( dir: Direction, flags: Flags, packet_type: PacketType, ) -> Self
Fill packet with known data. The rest gets filled by packet_codec.
pub fn new_from_data(dir: Direction, data: Vec<u8>) -> Self
pub fn into_vec(self) -> Vec<u8> ⓘ
pub fn data(&self) -> &[u8] ⓘ
pub fn data_mut(&mut self) -> &mut Vec<u8> ⓘ
pub fn content(&self) -> &[u8] ⓘ
pub fn content_mut(&mut self) -> &mut [u8] ⓘ
pub fn direction(&self) -> Direction
pub fn header(&self) -> InHeader<'_>
pub fn header_bytes(&self) -> &[u8] ⓘ
pub fn packet(&self) -> InPacket<'_>
pub fn mac(&mut self) -> &mut [u8; 8]
pub fn packet_id(&mut self, packet_id: u16)
pub fn client_id(&mut self, client_id: u16)
pub fn flags(&mut self, flags: Flags)
pub fn packet_type(&mut self, packet_type: PacketType)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for OutPacket
impl<'de> Deserialize<'de> for OutPacket
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
impl Eq for OutPacket
impl StructuralPartialEq for OutPacket
Auto Trait Implementations§
impl Freeze for OutPacket
impl RefUnwindSafe for OutPacket
impl Send for OutPacket
impl Sync for OutPacket
impl Unpin for OutPacket
impl UnwindSafe for OutPacket
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