Crate fifo [] [src]

A first-in-first-out bytes ring-buffer like kfifo in Linux.

Modules

splice

Zero-copy interface for Sender and Receiver, in splice style in Linux. When you want to write bytes into the ring-buffer from a Read, or read bytes from this into a Write, you can use SpliceRead and SpliceWrite.

Structs

Receiver

The fifo receiver. It's Send but !Send.

Sender

The fifo sender. It's Send but !Send.

Functions

align_up_for_fifo_size

Align the request size up to power of 2. If it's still less then 128 after aligned, then use 128 as return value.

fifo

Construct the fifo with capacity as align_up_for_fifo_size(usize), and return the Sender and Receiver pair connected with that.