Struct x11rb_protocol::packet_reader::PacketReader
source · [−]pub struct PacketReader { /* private fields */ }
Expand description
A wrapper around a buffer used to read X11 packets.
Implementations
sourceimpl PacketReader
impl PacketReader
sourcepub fn buffer(&mut self) -> &mut [u8]ⓘNotable traits for &'_ [u8]impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
pub fn buffer(&mut self) -> &mut [u8]ⓘNotable traits for &'_ [u8]impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ 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
sourceimpl Debug for PacketReader
impl Debug for PacketReader
Auto Trait Implementations
impl RefUnwindSafe for PacketReader
impl Send for PacketReader
impl Sync for PacketReader
impl Unpin for PacketReader
impl UnwindSafe for PacketReader
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more