writeStructs = (encoder, structs, client, clock) => {
  // write first id
  clock = math.max(clock, structs[0].id.clock); // make sure the first id exists

  const startNewStructs = findIndexSS(structs, clock); // write # encoded structs

  encoding.writeVarUint(encoder.restEncoder, structs.length - startNewStructs);
  encoder.writeClient(client);
  encoding.writeVarUint(encoder.restEncoder, clock);
  const firstStruct = structs[startNewStructs]; // write first struct with an offset

  firstStruct.write(encoder, clock - firstStruct.id.clock);

  for (let i = startNewStructs + 1; i < structs.length; i++) {
    structs[i].write(encoder, 0);
  }
}
@param {UpdateEncoderV1 | UpdateEncoderV2} encoder
@param {Array<GC|Item>} structs All structs by `client`
@param {number} client
@param {number} clock write structs starting with `ID(client,clock)`

@function