Skip to main content

build_list_write_chunks

Function build_list_write_chunks 

Source
pub fn build_list_write_chunks(
    path: AttributePath,
    element_tlvs: &[Vec<u8>],
    budget: usize,
    timed: bool,
) -> Vec<Vec<u8>>
Expand description

Build one or more WriteRequestMessages that write element_tlvs (each a pre-encoded anonymous-tagged list element) to path as a list, splitting across messages so each stays within budget unencrypted bytes.

Chunk 0 is a ReplaceAll (path without ListIndex; Data = an array of the elements that fit). Remaining elements are emitted as AppendItem IBs (path with ListIndex=null). MoreChunkedMessages (ctx3) is set on every message except the last.

When everything fits one message the result is a single ReplaceAll byte-identical to build_write_request(&[AttributeWriteRequest{path, value_tlv: <the full array encoded>}]).

An empty element_tlvs yields a single empty-array ReplaceAll.