Persistent (on-disk) circular buffer

Hi,

I need a persistent (persistent, as in stored on disk, ideally crash tolerant) circular buffer for storing arbitrary binary items. My use case is to buffer outgoing messages during network outages, system reboots etc in a MQTT client.

I've looked around for on-disk circular/ring buffers on crates-io etc, but haven't found anything suitable.

Any recommendations? If not, any pointers to good implementations in other languages that I could potentially rewrite in rust.

Thanks,

Lars