pub enum ReplicaEvent {
Frame(DecodedFrame),
SnapshotBegin,
SnapshotChunk(Vec<u8>),
SnapshotEnd {
ack_offset: u64,
},
}Expand description
Event yielded by ReplicaClient::next_event. A driver loop
pattern-matches and applies each:
Self::Frame→ run through the local dispatcher.Self::SnapshotBegin→ caller should reset / prepare the local store for a fresh-from-snapshot fill.Self::SnapshotChunk→ append the bytes to the caller’s accumulating snapshot buffer.Self::SnapshotEnd→ caller hands the accumulated buffer tokevy_persist::load_snapshot;ReplicaClienthas already advancedexpected_offsettoack_offset, so the nextSelf::Framearrives atack_offsetwith no gap.
Variants§
Frame(DecodedFrame)
A live mutation frame.
SnapshotBegin
Snapshot ship begin marker (+SNAPSHOT\r\n).
SnapshotChunk(Vec<u8>)
One snapshot chunk’s payload bytes (RESP bulk string body).
SnapshotEnd
Snapshot ship end marker carrying the offset the next live frame will have.
Fields
§
ack_offset: u64The offset the primary’s next_offset was at when the
snapshot started. After this event, ReplicaClient::expected_offset
equals this value.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ReplicaEvent
impl RefUnwindSafe for ReplicaEvent
impl Send for ReplicaEvent
impl Sync for ReplicaEvent
impl Unpin for ReplicaEvent
impl UnsafeUnpin for ReplicaEvent
impl UnwindSafe for ReplicaEvent
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more