pub struct PacketReader { /* private fields */ }
Expand description

A wrapper around a buffer used to read X11 packets.

Implementations

Create a new, empty PacketReader.

Example
let reader = PacketReader::new();

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);

The remaining capacity that needs to be filled.

Advance this buffer by the given amount.

This will return the packet that was read, if enough bytes were read in order to form a complete packet.

Trait Implementations

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.