Skip to main content

encode_ack

Function encode_ack 

Source
pub fn encode_ack(at: FeedPosition) -> Vec<u8> ⓘ
Expand description

Encode the primary’s +ACK <generation> <current-offset>\r\n response. at.generation is the primary’s CURRENT feed generation — the replica records it as the generation of whatever data this session delivers (frames or snapshot) — and at.offset the granted resume offset.

use kevy_replicate::feed::FeedPosition;

assert_eq!(kevy_replicate::handshake::encode_ack(FeedPosition::new(7, 42)), b"+ACK 7 42\r\n");