use crate::stream_service::*;
impl serde::Serialize for BarrierCompleteResponse {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if !self.request_id.is_empty() {
len += 1;
}
if self.status.is_some() {
len += 1;
}
if !self.create_mview_progress.is_empty() {
len += 1;
}
if !self.synced_sstables.is_empty() {
len += 1;
}
if self.worker_id != 0 {
len += 1;
}
if !self.table_watermarks.is_empty() {
len += 1;
}
if !self.old_value_sstables.is_empty() {
len += 1;
}
if self.partial_graph_id != 0 {
len += 1;
}
if self.epoch != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_service.BarrierCompleteResponse", len)?;
if !self.request_id.is_empty() {
struct_ser.serialize_field("requestId", &self.request_id)?;
}
if let Some(v) = self.status.as_ref() {
struct_ser.serialize_field("status", v)?;
}
if !self.create_mview_progress.is_empty() {
struct_ser.serialize_field("createMviewProgress", &self.create_mview_progress)?;
}
if !self.synced_sstables.is_empty() {
struct_ser.serialize_field("syncedSstables", &self.synced_sstables)?;
}
if self.worker_id != 0 {
struct_ser.serialize_field("workerId", &self.worker_id)?;
}
if !self.table_watermarks.is_empty() {
struct_ser.serialize_field("tableWatermarks", &self.table_watermarks)?;
}
if !self.old_value_sstables.is_empty() {
struct_ser.serialize_field("oldValueSstables", &self.old_value_sstables)?;
}
if self.partial_graph_id != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("partialGraphId", ToString::to_string(&self.partial_graph_id).as_str())?;
}
if self.epoch != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("epoch", ToString::to_string(&self.epoch).as_str())?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for BarrierCompleteResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"request_id",
"requestId",
"status",
"create_mview_progress",
"createMviewProgress",
"synced_sstables",
"syncedSstables",
"worker_id",
"workerId",
"table_watermarks",
"tableWatermarks",
"old_value_sstables",
"oldValueSstables",
"partial_graph_id",
"partialGraphId",
"epoch",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
RequestId,
Status,
CreateMviewProgress,
SyncedSstables,
WorkerId,
TableWatermarks,
OldValueSstables,
PartialGraphId,
Epoch,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"requestId" | "request_id" => Ok(GeneratedField::RequestId),
"status" => Ok(GeneratedField::Status),
"createMviewProgress" | "create_mview_progress" => Ok(GeneratedField::CreateMviewProgress),
"syncedSstables" | "synced_sstables" => Ok(GeneratedField::SyncedSstables),
"workerId" | "worker_id" => Ok(GeneratedField::WorkerId),
"tableWatermarks" | "table_watermarks" => Ok(GeneratedField::TableWatermarks),
"oldValueSstables" | "old_value_sstables" => Ok(GeneratedField::OldValueSstables),
"partialGraphId" | "partial_graph_id" => Ok(GeneratedField::PartialGraphId),
"epoch" => Ok(GeneratedField::Epoch),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = BarrierCompleteResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_service.BarrierCompleteResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<BarrierCompleteResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut request_id__ = None;
let mut status__ = None;
let mut create_mview_progress__ = None;
let mut synced_sstables__ = None;
let mut worker_id__ = None;
let mut table_watermarks__ = None;
let mut old_value_sstables__ = None;
let mut partial_graph_id__ = None;
let mut epoch__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::RequestId => {
if request_id__.is_some() {
return Err(serde::de::Error::duplicate_field("requestId"));
}
request_id__ = Some(map_.next_value()?);
}
GeneratedField::Status => {
if status__.is_some() {
return Err(serde::de::Error::duplicate_field("status"));
}
status__ = map_.next_value()?;
}
GeneratedField::CreateMviewProgress => {
if create_mview_progress__.is_some() {
return Err(serde::de::Error::duplicate_field("createMviewProgress"));
}
create_mview_progress__ = Some(map_.next_value()?);
}
GeneratedField::SyncedSstables => {
if synced_sstables__.is_some() {
return Err(serde::de::Error::duplicate_field("syncedSstables"));
}
synced_sstables__ = Some(map_.next_value()?);
}
GeneratedField::WorkerId => {
if worker_id__.is_some() {
return Err(serde::de::Error::duplicate_field("workerId"));
}
worker_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::TableWatermarks => {
if table_watermarks__.is_some() {
return Err(serde::de::Error::duplicate_field("tableWatermarks"));
}
table_watermarks__ = Some(
map_.next_value::<std::collections::HashMap<::pbjson::private::NumberDeserialize<u32>, _>>()?
.into_iter().map(|(k,v)| (k.0, v)).collect()
);
}
GeneratedField::OldValueSstables => {
if old_value_sstables__.is_some() {
return Err(serde::de::Error::duplicate_field("oldValueSstables"));
}
old_value_sstables__ = Some(map_.next_value()?);
}
GeneratedField::PartialGraphId => {
if partial_graph_id__.is_some() {
return Err(serde::de::Error::duplicate_field("partialGraphId"));
}
partial_graph_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::Epoch => {
if epoch__.is_some() {
return Err(serde::de::Error::duplicate_field("epoch"));
}
epoch__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
}
}
Ok(BarrierCompleteResponse {
request_id: request_id__.unwrap_or_default(),
status: status__,
create_mview_progress: create_mview_progress__.unwrap_or_default(),
synced_sstables: synced_sstables__.unwrap_or_default(),
worker_id: worker_id__.unwrap_or_default(),
table_watermarks: table_watermarks__.unwrap_or_default(),
old_value_sstables: old_value_sstables__.unwrap_or_default(),
partial_graph_id: partial_graph_id__.unwrap_or_default(),
epoch: epoch__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("stream_service.BarrierCompleteResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for barrier_complete_response::CreateMviewProgress {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.backfill_actor_id != 0 {
len += 1;
}
if self.done {
len += 1;
}
if self.consumed_epoch != 0 {
len += 1;
}
if self.consumed_rows != 0 {
len += 1;
}
if self.pending_barrier_num != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_service.BarrierCompleteResponse.CreateMviewProgress", len)?;
if self.backfill_actor_id != 0 {
struct_ser.serialize_field("backfillActorId", &self.backfill_actor_id)?;
}
if self.done {
struct_ser.serialize_field("done", &self.done)?;
}
if self.consumed_epoch != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("consumedEpoch", ToString::to_string(&self.consumed_epoch).as_str())?;
}
if self.consumed_rows != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("consumedRows", ToString::to_string(&self.consumed_rows).as_str())?;
}
if self.pending_barrier_num != 0 {
struct_ser.serialize_field("pendingBarrierNum", &self.pending_barrier_num)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for barrier_complete_response::CreateMviewProgress {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"backfill_actor_id",
"backfillActorId",
"done",
"consumed_epoch",
"consumedEpoch",
"consumed_rows",
"consumedRows",
"pending_barrier_num",
"pendingBarrierNum",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
BackfillActorId,
Done,
ConsumedEpoch,
ConsumedRows,
PendingBarrierNum,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"backfillActorId" | "backfill_actor_id" => Ok(GeneratedField::BackfillActorId),
"done" => Ok(GeneratedField::Done),
"consumedEpoch" | "consumed_epoch" => Ok(GeneratedField::ConsumedEpoch),
"consumedRows" | "consumed_rows" => Ok(GeneratedField::ConsumedRows),
"pendingBarrierNum" | "pending_barrier_num" => Ok(GeneratedField::PendingBarrierNum),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = barrier_complete_response::CreateMviewProgress;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_service.BarrierCompleteResponse.CreateMviewProgress")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<barrier_complete_response::CreateMviewProgress, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut backfill_actor_id__ = None;
let mut done__ = None;
let mut consumed_epoch__ = None;
let mut consumed_rows__ = None;
let mut pending_barrier_num__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::BackfillActorId => {
if backfill_actor_id__.is_some() {
return Err(serde::de::Error::duplicate_field("backfillActorId"));
}
backfill_actor_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::Done => {
if done__.is_some() {
return Err(serde::de::Error::duplicate_field("done"));
}
done__ = Some(map_.next_value()?);
}
GeneratedField::ConsumedEpoch => {
if consumed_epoch__.is_some() {
return Err(serde::de::Error::duplicate_field("consumedEpoch"));
}
consumed_epoch__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::ConsumedRows => {
if consumed_rows__.is_some() {
return Err(serde::de::Error::duplicate_field("consumedRows"));
}
consumed_rows__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::PendingBarrierNum => {
if pending_barrier_num__.is_some() {
return Err(serde::de::Error::duplicate_field("pendingBarrierNum"));
}
pending_barrier_num__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
}
}
Ok(barrier_complete_response::CreateMviewProgress {
backfill_actor_id: backfill_actor_id__.unwrap_or_default(),
done: done__.unwrap_or_default(),
consumed_epoch: consumed_epoch__.unwrap_or_default(),
consumed_rows: consumed_rows__.unwrap_or_default(),
pending_barrier_num: pending_barrier_num__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("stream_service.BarrierCompleteResponse.CreateMviewProgress", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for barrier_complete_response::LocalSstableInfo {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.sst.is_some() {
len += 1;
}
if !self.table_stats_map.is_empty() {
len += 1;
}
if self.created_at != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_service.BarrierCompleteResponse.LocalSstableInfo", len)?;
if let Some(v) = self.sst.as_ref() {
struct_ser.serialize_field("sst", v)?;
}
if !self.table_stats_map.is_empty() {
struct_ser.serialize_field("tableStatsMap", &self.table_stats_map)?;
}
if self.created_at != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("createdAt", ToString::to_string(&self.created_at).as_str())?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for barrier_complete_response::LocalSstableInfo {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"sst",
"table_stats_map",
"tableStatsMap",
"created_at",
"createdAt",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Sst,
TableStatsMap,
CreatedAt,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"sst" => Ok(GeneratedField::Sst),
"tableStatsMap" | "table_stats_map" => Ok(GeneratedField::TableStatsMap),
"createdAt" | "created_at" => Ok(GeneratedField::CreatedAt),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = barrier_complete_response::LocalSstableInfo;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_service.BarrierCompleteResponse.LocalSstableInfo")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<barrier_complete_response::LocalSstableInfo, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut sst__ = None;
let mut table_stats_map__ = None;
let mut created_at__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Sst => {
if sst__.is_some() {
return Err(serde::de::Error::duplicate_field("sst"));
}
sst__ = map_.next_value()?;
}
GeneratedField::TableStatsMap => {
if table_stats_map__.is_some() {
return Err(serde::de::Error::duplicate_field("tableStatsMap"));
}
table_stats_map__ = Some(
map_.next_value::<std::collections::HashMap<::pbjson::private::NumberDeserialize<u32>, _>>()?
.into_iter().map(|(k,v)| (k.0, v)).collect()
);
}
GeneratedField::CreatedAt => {
if created_at__.is_some() {
return Err(serde::de::Error::duplicate_field("createdAt"));
}
created_at__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
}
}
Ok(barrier_complete_response::LocalSstableInfo {
sst: sst__,
table_stats_map: table_stats_map__.unwrap_or_default(),
created_at: created_at__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("stream_service.BarrierCompleteResponse.LocalSstableInfo", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for GetMinUncommittedSstIdRequest {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let len = 0;
let struct_ser = serializer.serialize_struct("stream_service.GetMinUncommittedSstIdRequest", len)?;
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for GetMinUncommittedSstIdRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
Err(serde::de::Error::unknown_field(value, FIELDS))
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GetMinUncommittedSstIdRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_service.GetMinUncommittedSstIdRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<GetMinUncommittedSstIdRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
while map_.next_key::<GeneratedField>()?.is_some() {
let _ = map_.next_value::<serde::de::IgnoredAny>()?;
}
Ok(GetMinUncommittedSstIdRequest {
})
}
}
deserializer.deserialize_struct("stream_service.GetMinUncommittedSstIdRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for GetMinUncommittedSstIdResponse {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.min_uncommitted_sst_id != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_service.GetMinUncommittedSstIdResponse", len)?;
if self.min_uncommitted_sst_id != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("minUncommittedSstId", ToString::to_string(&self.min_uncommitted_sst_id).as_str())?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for GetMinUncommittedSstIdResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"min_uncommitted_sst_id",
"minUncommittedSstId",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
MinUncommittedSstId,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"minUncommittedSstId" | "min_uncommitted_sst_id" => Ok(GeneratedField::MinUncommittedSstId),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GetMinUncommittedSstIdResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_service.GetMinUncommittedSstIdResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<GetMinUncommittedSstIdResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut min_uncommitted_sst_id__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::MinUncommittedSstId => {
if min_uncommitted_sst_id__.is_some() {
return Err(serde::de::Error::duplicate_field("minUncommittedSstId"));
}
min_uncommitted_sst_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
}
}
Ok(GetMinUncommittedSstIdResponse {
min_uncommitted_sst_id: min_uncommitted_sst_id__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("stream_service.GetMinUncommittedSstIdResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for InjectBarrierRequest {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if !self.request_id.is_empty() {
len += 1;
}
if self.barrier.is_some() {
len += 1;
}
if !self.actor_ids_to_collect.is_empty() {
len += 1;
}
if !self.table_ids_to_sync.is_empty() {
len += 1;
}
if self.partial_graph_id != 0 {
len += 1;
}
if !self.broadcast_info.is_empty() {
len += 1;
}
if !self.actors_to_build.is_empty() {
len += 1;
}
if !self.subscriptions_to_add.is_empty() {
len += 1;
}
if !self.subscriptions_to_remove.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_service.InjectBarrierRequest", len)?;
if !self.request_id.is_empty() {
struct_ser.serialize_field("requestId", &self.request_id)?;
}
if let Some(v) = self.barrier.as_ref() {
struct_ser.serialize_field("barrier", v)?;
}
if !self.actor_ids_to_collect.is_empty() {
struct_ser.serialize_field("actorIdsToCollect", &self.actor_ids_to_collect)?;
}
if !self.table_ids_to_sync.is_empty() {
struct_ser.serialize_field("tableIdsToSync", &self.table_ids_to_sync)?;
}
if self.partial_graph_id != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("partialGraphId", ToString::to_string(&self.partial_graph_id).as_str())?;
}
if !self.broadcast_info.is_empty() {
struct_ser.serialize_field("broadcastInfo", &self.broadcast_info)?;
}
if !self.actors_to_build.is_empty() {
struct_ser.serialize_field("actorsToBuild", &self.actors_to_build)?;
}
if !self.subscriptions_to_add.is_empty() {
struct_ser.serialize_field("subscriptionsToAdd", &self.subscriptions_to_add)?;
}
if !self.subscriptions_to_remove.is_empty() {
struct_ser.serialize_field("subscriptionsToRemove", &self.subscriptions_to_remove)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for InjectBarrierRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"request_id",
"requestId",
"barrier",
"actor_ids_to_collect",
"actorIdsToCollect",
"table_ids_to_sync",
"tableIdsToSync",
"partial_graph_id",
"partialGraphId",
"broadcast_info",
"broadcastInfo",
"actors_to_build",
"actorsToBuild",
"subscriptions_to_add",
"subscriptionsToAdd",
"subscriptions_to_remove",
"subscriptionsToRemove",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
RequestId,
Barrier,
ActorIdsToCollect,
TableIdsToSync,
PartialGraphId,
BroadcastInfo,
ActorsToBuild,
SubscriptionsToAdd,
SubscriptionsToRemove,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"requestId" | "request_id" => Ok(GeneratedField::RequestId),
"barrier" => Ok(GeneratedField::Barrier),
"actorIdsToCollect" | "actor_ids_to_collect" => Ok(GeneratedField::ActorIdsToCollect),
"tableIdsToSync" | "table_ids_to_sync" => Ok(GeneratedField::TableIdsToSync),
"partialGraphId" | "partial_graph_id" => Ok(GeneratedField::PartialGraphId),
"broadcastInfo" | "broadcast_info" => Ok(GeneratedField::BroadcastInfo),
"actorsToBuild" | "actors_to_build" => Ok(GeneratedField::ActorsToBuild),
"subscriptionsToAdd" | "subscriptions_to_add" => Ok(GeneratedField::SubscriptionsToAdd),
"subscriptionsToRemove" | "subscriptions_to_remove" => Ok(GeneratedField::SubscriptionsToRemove),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = InjectBarrierRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_service.InjectBarrierRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<InjectBarrierRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut request_id__ = None;
let mut barrier__ = None;
let mut actor_ids_to_collect__ = None;
let mut table_ids_to_sync__ = None;
let mut partial_graph_id__ = None;
let mut broadcast_info__ = None;
let mut actors_to_build__ = None;
let mut subscriptions_to_add__ = None;
let mut subscriptions_to_remove__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::RequestId => {
if request_id__.is_some() {
return Err(serde::de::Error::duplicate_field("requestId"));
}
request_id__ = Some(map_.next_value()?);
}
GeneratedField::Barrier => {
if barrier__.is_some() {
return Err(serde::de::Error::duplicate_field("barrier"));
}
barrier__ = map_.next_value()?;
}
GeneratedField::ActorIdsToCollect => {
if actor_ids_to_collect__.is_some() {
return Err(serde::de::Error::duplicate_field("actorIdsToCollect"));
}
actor_ids_to_collect__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
GeneratedField::TableIdsToSync => {
if table_ids_to_sync__.is_some() {
return Err(serde::de::Error::duplicate_field("tableIdsToSync"));
}
table_ids_to_sync__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
GeneratedField::PartialGraphId => {
if partial_graph_id__.is_some() {
return Err(serde::de::Error::duplicate_field("partialGraphId"));
}
partial_graph_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::BroadcastInfo => {
if broadcast_info__.is_some() {
return Err(serde::de::Error::duplicate_field("broadcastInfo"));
}
broadcast_info__ = Some(map_.next_value()?);
}
GeneratedField::ActorsToBuild => {
if actors_to_build__.is_some() {
return Err(serde::de::Error::duplicate_field("actorsToBuild"));
}
actors_to_build__ = Some(map_.next_value()?);
}
GeneratedField::SubscriptionsToAdd => {
if subscriptions_to_add__.is_some() {
return Err(serde::de::Error::duplicate_field("subscriptionsToAdd"));
}
subscriptions_to_add__ = Some(map_.next_value()?);
}
GeneratedField::SubscriptionsToRemove => {
if subscriptions_to_remove__.is_some() {
return Err(serde::de::Error::duplicate_field("subscriptionsToRemove"));
}
subscriptions_to_remove__ = Some(map_.next_value()?);
}
}
}
Ok(InjectBarrierRequest {
request_id: request_id__.unwrap_or_default(),
barrier: barrier__,
actor_ids_to_collect: actor_ids_to_collect__.unwrap_or_default(),
table_ids_to_sync: table_ids_to_sync__.unwrap_or_default(),
partial_graph_id: partial_graph_id__.unwrap_or_default(),
broadcast_info: broadcast_info__.unwrap_or_default(),
actors_to_build: actors_to_build__.unwrap_or_default(),
subscriptions_to_add: subscriptions_to_add__.unwrap_or_default(),
subscriptions_to_remove: subscriptions_to_remove__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("stream_service.InjectBarrierRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for StreamingControlStreamRequest {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.request.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_service.StreamingControlStreamRequest", len)?;
if let Some(v) = self.request.as_ref() {
match v {
streaming_control_stream_request::Request::Init(v) => {
struct_ser.serialize_field("init", v)?;
}
streaming_control_stream_request::Request::InjectBarrier(v) => {
struct_ser.serialize_field("injectBarrier", v)?;
}
streaming_control_stream_request::Request::RemovePartialGraph(v) => {
struct_ser.serialize_field("removePartialGraph", v)?;
}
streaming_control_stream_request::Request::CreatePartialGraph(v) => {
struct_ser.serialize_field("createPartialGraph", v)?;
}
}
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for StreamingControlStreamRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"init",
"inject_barrier",
"injectBarrier",
"remove_partial_graph",
"removePartialGraph",
"create_partial_graph",
"createPartialGraph",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Init,
InjectBarrier,
RemovePartialGraph,
CreatePartialGraph,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"init" => Ok(GeneratedField::Init),
"injectBarrier" | "inject_barrier" => Ok(GeneratedField::InjectBarrier),
"removePartialGraph" | "remove_partial_graph" => Ok(GeneratedField::RemovePartialGraph),
"createPartialGraph" | "create_partial_graph" => Ok(GeneratedField::CreatePartialGraph),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = StreamingControlStreamRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_service.StreamingControlStreamRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<StreamingControlStreamRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut request__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Init => {
if request__.is_some() {
return Err(serde::de::Error::duplicate_field("init"));
}
request__ = map_.next_value::<::std::option::Option<_>>()?.map(streaming_control_stream_request::Request::Init)
;
}
GeneratedField::InjectBarrier => {
if request__.is_some() {
return Err(serde::de::Error::duplicate_field("injectBarrier"));
}
request__ = map_.next_value::<::std::option::Option<_>>()?.map(streaming_control_stream_request::Request::InjectBarrier)
;
}
GeneratedField::RemovePartialGraph => {
if request__.is_some() {
return Err(serde::de::Error::duplicate_field("removePartialGraph"));
}
request__ = map_.next_value::<::std::option::Option<_>>()?.map(streaming_control_stream_request::Request::RemovePartialGraph)
;
}
GeneratedField::CreatePartialGraph => {
if request__.is_some() {
return Err(serde::de::Error::duplicate_field("createPartialGraph"));
}
request__ = map_.next_value::<::std::option::Option<_>>()?.map(streaming_control_stream_request::Request::CreatePartialGraph)
;
}
}
}
Ok(StreamingControlStreamRequest {
request: request__,
})
}
}
deserializer.deserialize_struct("stream_service.StreamingControlStreamRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for streaming_control_stream_request::CreatePartialGraphRequest {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.partial_graph_id != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_service.StreamingControlStreamRequest.CreatePartialGraphRequest", len)?;
if self.partial_graph_id != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("partialGraphId", ToString::to_string(&self.partial_graph_id).as_str())?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for streaming_control_stream_request::CreatePartialGraphRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"partial_graph_id",
"partialGraphId",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
PartialGraphId,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"partialGraphId" | "partial_graph_id" => Ok(GeneratedField::PartialGraphId),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = streaming_control_stream_request::CreatePartialGraphRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_service.StreamingControlStreamRequest.CreatePartialGraphRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<streaming_control_stream_request::CreatePartialGraphRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut partial_graph_id__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::PartialGraphId => {
if partial_graph_id__.is_some() {
return Err(serde::de::Error::duplicate_field("partialGraphId"));
}
partial_graph_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
}
}
Ok(streaming_control_stream_request::CreatePartialGraphRequest {
partial_graph_id: partial_graph_id__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("stream_service.StreamingControlStreamRequest.CreatePartialGraphRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for streaming_control_stream_request::InitRequest {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if !self.graphs.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_service.StreamingControlStreamRequest.InitRequest", len)?;
if !self.graphs.is_empty() {
struct_ser.serialize_field("graphs", &self.graphs)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for streaming_control_stream_request::InitRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"graphs",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Graphs,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"graphs" => Ok(GeneratedField::Graphs),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = streaming_control_stream_request::InitRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_service.StreamingControlStreamRequest.InitRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<streaming_control_stream_request::InitRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut graphs__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Graphs => {
if graphs__.is_some() {
return Err(serde::de::Error::duplicate_field("graphs"));
}
graphs__ = Some(map_.next_value()?);
}
}
}
Ok(streaming_control_stream_request::InitRequest {
graphs: graphs__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("stream_service.StreamingControlStreamRequest.InitRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for streaming_control_stream_request::InitialPartialGraph {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.partial_graph_id != 0 {
len += 1;
}
if !self.subscriptions.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_service.StreamingControlStreamRequest.InitialPartialGraph", len)?;
if self.partial_graph_id != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("partialGraphId", ToString::to_string(&self.partial_graph_id).as_str())?;
}
if !self.subscriptions.is_empty() {
struct_ser.serialize_field("subscriptions", &self.subscriptions)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for streaming_control_stream_request::InitialPartialGraph {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"partial_graph_id",
"partialGraphId",
"subscriptions",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
PartialGraphId,
Subscriptions,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"partialGraphId" | "partial_graph_id" => Ok(GeneratedField::PartialGraphId),
"subscriptions" => Ok(GeneratedField::Subscriptions),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = streaming_control_stream_request::InitialPartialGraph;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_service.StreamingControlStreamRequest.InitialPartialGraph")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<streaming_control_stream_request::InitialPartialGraph, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut partial_graph_id__ = None;
let mut subscriptions__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::PartialGraphId => {
if partial_graph_id__.is_some() {
return Err(serde::de::Error::duplicate_field("partialGraphId"));
}
partial_graph_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::Subscriptions => {
if subscriptions__.is_some() {
return Err(serde::de::Error::duplicate_field("subscriptions"));
}
subscriptions__ = Some(map_.next_value()?);
}
}
}
Ok(streaming_control_stream_request::InitialPartialGraph {
partial_graph_id: partial_graph_id__.unwrap_or_default(),
subscriptions: subscriptions__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("stream_service.StreamingControlStreamRequest.InitialPartialGraph", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for streaming_control_stream_request::RemovePartialGraphRequest {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if !self.partial_graph_ids.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_service.StreamingControlStreamRequest.RemovePartialGraphRequest", len)?;
if !self.partial_graph_ids.is_empty() {
struct_ser.serialize_field("partialGraphIds", &self.partial_graph_ids.iter().map(ToString::to_string).collect::<Vec<_>>())?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for streaming_control_stream_request::RemovePartialGraphRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"partial_graph_ids",
"partialGraphIds",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
PartialGraphIds,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"partialGraphIds" | "partial_graph_ids" => Ok(GeneratedField::PartialGraphIds),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = streaming_control_stream_request::RemovePartialGraphRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_service.StreamingControlStreamRequest.RemovePartialGraphRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<streaming_control_stream_request::RemovePartialGraphRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut partial_graph_ids__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::PartialGraphIds => {
if partial_graph_ids__.is_some() {
return Err(serde::de::Error::duplicate_field("partialGraphIds"));
}
partial_graph_ids__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
}
}
Ok(streaming_control_stream_request::RemovePartialGraphRequest {
partial_graph_ids: partial_graph_ids__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("stream_service.StreamingControlStreamRequest.RemovePartialGraphRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for StreamingControlStreamResponse {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.response.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_service.StreamingControlStreamResponse", len)?;
if let Some(v) = self.response.as_ref() {
match v {
streaming_control_stream_response::Response::Init(v) => {
struct_ser.serialize_field("init", v)?;
}
streaming_control_stream_response::Response::CompleteBarrier(v) => {
struct_ser.serialize_field("completeBarrier", v)?;
}
streaming_control_stream_response::Response::Shutdown(v) => {
struct_ser.serialize_field("shutdown", v)?;
}
}
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for StreamingControlStreamResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"init",
"complete_barrier",
"completeBarrier",
"shutdown",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Init,
CompleteBarrier,
Shutdown,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"init" => Ok(GeneratedField::Init),
"completeBarrier" | "complete_barrier" => Ok(GeneratedField::CompleteBarrier),
"shutdown" => Ok(GeneratedField::Shutdown),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = StreamingControlStreamResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_service.StreamingControlStreamResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<StreamingControlStreamResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut response__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Init => {
if response__.is_some() {
return Err(serde::de::Error::duplicate_field("init"));
}
response__ = map_.next_value::<::std::option::Option<_>>()?.map(streaming_control_stream_response::Response::Init)
;
}
GeneratedField::CompleteBarrier => {
if response__.is_some() {
return Err(serde::de::Error::duplicate_field("completeBarrier"));
}
response__ = map_.next_value::<::std::option::Option<_>>()?.map(streaming_control_stream_response::Response::CompleteBarrier)
;
}
GeneratedField::Shutdown => {
if response__.is_some() {
return Err(serde::de::Error::duplicate_field("shutdown"));
}
response__ = map_.next_value::<::std::option::Option<_>>()?.map(streaming_control_stream_response::Response::Shutdown)
;
}
}
}
Ok(StreamingControlStreamResponse {
response: response__,
})
}
}
deserializer.deserialize_struct("stream_service.StreamingControlStreamResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for streaming_control_stream_response::InitResponse {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let len = 0;
let struct_ser = serializer.serialize_struct("stream_service.StreamingControlStreamResponse.InitResponse", len)?;
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for streaming_control_stream_response::InitResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
Err(serde::de::Error::unknown_field(value, FIELDS))
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = streaming_control_stream_response::InitResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_service.StreamingControlStreamResponse.InitResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<streaming_control_stream_response::InitResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
while map_.next_key::<GeneratedField>()?.is_some() {
let _ = map_.next_value::<serde::de::IgnoredAny>()?;
}
Ok(streaming_control_stream_response::InitResponse {
})
}
}
deserializer.deserialize_struct("stream_service.StreamingControlStreamResponse.InitResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for streaming_control_stream_response::ShutdownResponse {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let len = 0;
let struct_ser = serializer.serialize_struct("stream_service.StreamingControlStreamResponse.ShutdownResponse", len)?;
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for streaming_control_stream_response::ShutdownResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
Err(serde::de::Error::unknown_field(value, FIELDS))
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = streaming_control_stream_response::ShutdownResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_service.StreamingControlStreamResponse.ShutdownResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<streaming_control_stream_response::ShutdownResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
while map_.next_key::<GeneratedField>()?.is_some() {
let _ = map_.next_value::<serde::de::IgnoredAny>()?;
}
Ok(streaming_control_stream_response::ShutdownResponse {
})
}
}
deserializer.deserialize_struct("stream_service.StreamingControlStreamResponse.ShutdownResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for WaitEpochCommitRequest {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.epoch != 0 {
len += 1;
}
if self.table_id != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_service.WaitEpochCommitRequest", len)?;
if self.epoch != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("epoch", ToString::to_string(&self.epoch).as_str())?;
}
if self.table_id != 0 {
struct_ser.serialize_field("tableId", &self.table_id)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for WaitEpochCommitRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"epoch",
"table_id",
"tableId",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Epoch,
TableId,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"epoch" => Ok(GeneratedField::Epoch),
"tableId" | "table_id" => Ok(GeneratedField::TableId),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = WaitEpochCommitRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_service.WaitEpochCommitRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<WaitEpochCommitRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut epoch__ = None;
let mut table_id__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Epoch => {
if epoch__.is_some() {
return Err(serde::de::Error::duplicate_field("epoch"));
}
epoch__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::TableId => {
if table_id__.is_some() {
return Err(serde::de::Error::duplicate_field("tableId"));
}
table_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
}
}
Ok(WaitEpochCommitRequest {
epoch: epoch__.unwrap_or_default(),
table_id: table_id__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("stream_service.WaitEpochCommitRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for WaitEpochCommitResponse {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.status.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_service.WaitEpochCommitResponse", len)?;
if let Some(v) = self.status.as_ref() {
struct_ser.serialize_field("status", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for WaitEpochCommitResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"status",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Status,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"status" => Ok(GeneratedField::Status),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = WaitEpochCommitResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_service.WaitEpochCommitResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<WaitEpochCommitResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut status__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Status => {
if status__.is_some() {
return Err(serde::de::Error::duplicate_field("status"));
}
status__ = map_.next_value()?;
}
}
}
Ok(WaitEpochCommitResponse {
status: status__,
})
}
}
deserializer.deserialize_struct("stream_service.WaitEpochCommitResponse", FIELDS, GeneratedVisitor)
}
}