Expand description
xchannel: mmap-backed IPC channels with rolling files.
§Overview
- Regionized file layout; region 0 starts with a
MessageHeader(Channel)followed byChannelHeader. - Pre-header pipeline for user records: For record i: header(i) is pre-installed (committed=0), writer copies payload(i) after it, then fills header(i) and sets committed=1 (Release), and finally pre-installs header(i+1).
- Special markers:
Skip(pad to next region),Roll(file rolled).
§Safety
Writers produce &mut references into an mmap; do not run a reader in the
same process concurrently with a writer to the same file/region. For cross-process
IPC this is fine. Publishing uses Release and reading uses Acquire.
Structs§
- Message
Batch - Borrowed view over a batch of user messages.
- Message
Ref - Borrowed view of a message payload and header.
- Reader
- Reader
Builder - Region
Mapping - Encapsulates a single mmap-ed region.
ModeisMmap(read-only) orMmapMut(writable). - Writer
- Writer
Builder
Enums§
Functions§
- cleanup_
channel_ files - Remove channel base and all rolled files created by this crate.
Scans the parent directory for entries matching
baseandbase.<N>and removes them, so this works correctly even when retention has left a sparse set of rolled files (e.g. withWriterBuilder::keep_files). - page_
size - Return the OS page size.