risingwave_pb/
compute.serde.rsuse crate::compute::*;
impl serde::Serialize for ShowConfigRequest {
#[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("compute.ShowConfigRequest", len)?;
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for ShowConfigRequest {
#[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 = ShowConfigRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct compute.ShowConfigRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<ShowConfigRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
while map_.next_key::<GeneratedField>()?.is_some() {
let _ = map_.next_value::<serde::de::IgnoredAny>()?;
}
Ok(ShowConfigRequest {
})
}
}
deserializer.deserialize_struct("compute.ShowConfigRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for ShowConfigResponse {
#[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.batch_config.is_empty() {
len += 1;
}
if !self.stream_config.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("compute.ShowConfigResponse", len)?;
if !self.batch_config.is_empty() {
struct_ser.serialize_field("batchConfig", &self.batch_config)?;
}
if !self.stream_config.is_empty() {
struct_ser.serialize_field("streamConfig", &self.stream_config)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for ShowConfigResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"batch_config",
"batchConfig",
"stream_config",
"streamConfig",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
BatchConfig,
StreamConfig,
}
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 {
"batchConfig" | "batch_config" => Ok(GeneratedField::BatchConfig),
"streamConfig" | "stream_config" => Ok(GeneratedField::StreamConfig),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = ShowConfigResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct compute.ShowConfigResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<ShowConfigResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut batch_config__ = None;
let mut stream_config__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::BatchConfig => {
if batch_config__.is_some() {
return Err(serde::de::Error::duplicate_field("batchConfig"));
}
batch_config__ = Some(map_.next_value()?);
}
GeneratedField::StreamConfig => {
if stream_config__.is_some() {
return Err(serde::de::Error::duplicate_field("streamConfig"));
}
stream_config__ = Some(map_.next_value()?);
}
}
}
Ok(ShowConfigResponse {
batch_config: batch_config__.unwrap_or_default(),
stream_config: stream_config__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("compute.ShowConfigResponse", FIELDS, GeneratedVisitor)
}
}