Skip to main content

Module protocol

Module protocol 

Source
Expand description

Wire protocol for FixedStore replication.

Frame format: [type: u8][len: u32 LE][payload: len bytes]. All integers are little-endian. See spec §6 for the full message table.

Structs§

Ack
CaughtUp
ShardInfo
L→F: leader advertises shard topology after accepting a SyncRequest.
SlotBatchDecoder
Zero-copy decoder reading events out of a payload slice.
SlotBatchEncoder
Incremental encoder — caller adds events one at a time to avoid building an intermediate Vec of event structs.
SlotEventIter
SlotEventRef
SyncRequest
F→L: ask leader to sync the given shard.

Enums§

FixedMessageType

Constants§

ACK_INTERVAL
BATCH_MAX_BYTES
BATCH_MAX_ENTRIES
FLAG_EMPTY_STATE
Flags carried in SyncRequest.
HEARTBEAT_INTERVAL_SECS
MAX_FRAME_PAYLOAD
PROTOCOL_VERSION
TAIL_POLL_MS

Functions§

decode_error
encode_error
encode_heartbeat
read_frame
write_frame

Type Aliases§

Frame
FrameReader
Stateful, resumable frame reader for non-blocking / read-timeout sockets (shared implementation: crate::frame_reader). On a WouldBlock/ TimedOut mid-frame the buffered bytes are kept and the next call resumes exactly; after any terminal error discard the reader together with the connection.