Struct x11rb_protocol::packet_reader::PacketReader
source · pub struct PacketReader {
pending_packet: Vec<u8>,
already_read: usize,
}
Expand description
A wrapper around a buffer used to read X11 packets.
Fields§
§pending_packet: Vec<u8>
A partially-read packet.
already_read: usize
The point at which the packet is already read.
Implementations§
source§impl PacketReader
impl PacketReader
sourcepub fn buffer(&mut self) -> &mut [u8] ⓘ
pub fn buffer(&mut self) -> &mut [u8] ⓘ
Get the buffer that the reader should fill with data.
§Example
let mut reader = PacketReader::new();
let buffer: [u8; 32] = read_in_buffer();
reader.buffer().copy_from_slice(&buffer);
sourcepub fn remaining_capacity(&self) -> usize
pub fn remaining_capacity(&self) -> usize
The remaining capacity that needs to be filled.
Trait Implementations§
source§impl Debug for PacketReader
impl Debug for PacketReader
Auto Trait Implementations§
impl Freeze for PacketReader
impl RefUnwindSafe for PacketReader
impl Send for PacketReader
impl Sync for PacketReader
impl Unpin for PacketReader
impl UnwindSafe for PacketReader
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