Skip to main content

encode_replconf_ack

Function encode_replconf_ack 

Source
pub fn encode_replconf_ack(offset: u64) -> Vec<u8> ⓘ
Expand description

Encode the replica→primary acknowledgment line: REPLCONF ACK <offset>\r\n — inline RESP, written back on the SAME replication connection (the pump drains it non-blocking).

use kevy_replicate::wire::{decode_replconf_ack, encode_replconf_ack};

let line = encode_replconf_ack(128);
assert_eq!(line, b"REPLCONF ACK 128\r\n");
assert_eq!(decode_replconf_ack(&line)?, Some((128, line.len())));