pub struct HPacket {
pub read_index: usize,
pub identifier: String,
pub identifier_direction: HDirection,
/* private fields */
}
Fields§
§read_index: usize
§identifier: String
§identifier_direction: HDirection
Implementations§
Source§impl HPacket
impl HPacket
pub fn from_bytes(bytes: Vec<u8>) -> Self
pub fn from_packet(packet: HPacket) -> Self
pub fn from_header_id(header_id: i16) -> Self
pub fn from_header_id_and_bytes(header_id: i16, bytes: Vec<u8>) -> Self
pub fn from_identifier_and_direction( identifier: String, direction: HDirection, ) -> HPacket
pub fn from_string(s: String) -> HPacket
pub fn get_bytes_available(&mut self) -> usize
pub fn eof(&mut self) -> i8
pub fn can_send_to_client(&mut self) -> bool
pub fn can_send_to_server(&mut self) -> bool
pub fn is_complete(&mut self) -> bool
pub fn get_bytes(&self) -> Vec<u8> ⓘ
pub fn reset_read_index(&mut self)
pub fn is_corrupted(&mut self) -> bool
pub fn length(&mut self) -> usize
pub fn bytes_length(&self) -> usize
pub fn header_id(&mut self) -> i16
pub fn read_bytes(&mut self, length: usize) -> Vec<u8> ⓘ
pub fn read_bytes_at(&mut self, length: usize, index: usize) -> Vec<u8> ⓘ
pub fn read<T: PacketVariable>(&mut self) -> T
pub fn read_at<T: PacketVariable>(&mut self, index: usize) -> T
pub fn append_bytes(&mut self, bytes: Vec<u8>)
pub fn append<T: PacketVariable>(&mut self, v: T)
pub fn replace_bytes(&mut self, index: usize, bytes: Vec<u8>)
pub fn replace<T: PacketVariable>(&mut self, index: usize, v: T)
pub fn insert_bytes(&mut self, index: usize, bytes: Vec<u8>)
pub fn insert<T: PacketVariable>(&mut self, index: usize, v: T)
pub fn stringify(&self) -> String
Trait Implementations§
impl Eq for HPacket
impl StructuralPartialEq for HPacket
Auto Trait Implementations§
impl Freeze for HPacket
impl RefUnwindSafe for HPacket
impl Send for HPacket
impl Sync for HPacket
impl Unpin for HPacket
impl UnwindSafe for HPacket
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