Skip to main content

Module seqlock

Module seqlock 

Source
Expand description

Single-writer, multi-reader cell with seqlock-based validation.

The reader/writer protocol relies on torn reads being well-defined for T: bytemuck::AnyBitPattern: any bit pattern is a valid T, so a materialised torn value is at worst stale or garbled, never undefined behaviour. The surrounding sequence-number check rejects such reads before they leave Reader::read.

See new for the entry point, Writer for writing, and Reader for reading.

Structs§

Reader
A reading handle of a SeqLock.
Writer
The writing handle of a SeqLock.

Functions§

new
Creates a new seqlock initialised with initial_value.