pub fn encode_ref_as_bytes_local<'a>(
    messages: impl Iterator<Item = Result<&'a LogMsg, ChunkError>>
) -> Result<Vec<u8>, EncodeError>