Skip to main content

encode_with_header

Function encode_with_header 

Source
pub fn encode_with_header<T: DocumentType>(doc: &T) -> Vec<u8> 
Expand description

Encode a document with its type header.

Format:

[type_id: 1B]   - 0xC0-0xCF
[flags: 1B]     - reserved (0x00)
[length: 2B]    - LE, payload length
[payload: var]  - type-specific encoding