size_t writeField(
    Protocol_* iprot,
    const FieldInfo& fieldInfo,
    const ThriftValue& value) {
  size_t written = iprot->writeFieldBegin(
      fieldInfo.name, fieldInfo.typeInfo->type, fieldInfo.id);
  written += write(iprot, *fieldInfo.typeInfo, value);
  written += iprot->writeFieldEnd();
  return written;
}
size_t writeField(
    Protocol_* iprot,
    const FieldInfo& fieldInfo,
    const ThriftValue& value) {
  size_t written = iprot->writeFieldBegin(
      fieldInfo.name, fieldInfo.typeInfo->type, fieldInfo.id);
  written += write(iprot, *fieldInfo.typeInfo, value);
  written += iprot->writeFieldEnd();
  return written;
}