pub struct Buffer<const Q: usize, const N: usize> { /* private fields */ }
Expand description

HID-IO byte buffer This buffer is a queue of vecs with static allocation Each vec is fixed sized as HID-IO interface has a fixed transport payload (even if the actual size of the message is less). This buffer has no notion of packet size so it must store the full transport payload. In the minimal scenario a queue size of 1 is used.

Common HID-IO Vec capacities

  • 7 bytes (USB 2.0 LS /w HID ID byte)
  • 8 bytes (USB 2.0 LS)
  • 63 bytes (USB 2.0 FS /w HID ID byte)
  • 64 bytes (USB 2.0 FS)
  • 1023 bytes (USB 2.0 HS /w HID ID byte)
  • 1024 bytes (USB 2.0 HS)

The maximum queue size is 255

Implementations

Constructor for Buffer

Remarks

Initialize as blank This buffer has a limit of 65535 elements

Checks the first item array Returns None if there are no items in the queue Does not dequeue

Dequeues and returns the first item array Returns None if there are no items in the queue

Enqueues Returns the array if there’s not enough space

Clears the buffer Needed for some error conditions

Capacity of buffer

Number of elements stored in the buffer

Buffer empty

Buffer full

Trait Implementations

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.