Skip to main content

frame_message_v2

Function frame_message_v2 

Source
pub fn frame_message_v2(doc_id: &str, message: &[u8]) -> Vec<u8> 
Expand description

Frame a message for v2 protocol with fixed u8 length prefix.

Format: [u8: doc_id_len] [doc_id_bytes] [payload]

This is used for the siphonophore-based /sync2 endpoint which uses a simpler framing format than the v1 varUint encoding.

§Example

let framed = frame_message_v2("body:ws123/journal/2024.md", &sync_message);
// framed = [28] ["body:ws123/journal/2024.md"] [sync_message...]