#[derive(PartialOrd, Hash, Eq, Ord, Debug, Default, Clone, PartialEq)]
pub struct ThriftHiveMetastoreLockArgsRecv {
pub rqst: LockRequest,
}
impl ::pilota::thrift::Message for ThriftHiveMetastoreLockArgsRecv {
fn encode<T: ::pilota::thrift::TOutputProtocol>(
&self,
__protocol: &mut T,
) -> ::std::result::Result<(), ::pilota::thrift::ThriftException> {
#[allow(unused_imports)]
use ::pilota::thrift::TOutputProtocolExt;
let struct_ident = ::pilota::thrift::TStructIdentifier {
name: "ThriftHiveMetastoreLockArgsRecv",
};
__protocol.write_struct_begin(&struct_ident)?;
__protocol.write_struct_field(1, &self.rqst, ::pilota::thrift::TType::Struct)?;
__protocol.write_field_stop()?;
__protocol.write_struct_end()?;
::std::result::Result::Ok(())
}
fn decode<T: ::pilota::thrift::TInputProtocol>(
__protocol: &mut T,
) -> ::std::result::Result<Self, ::pilota::thrift::ThriftException> {
#[allow(unused_imports)]
use ::pilota::{thrift::TLengthProtocolExt, Buf};
let mut var_1 = None;
let mut __pilota_decoding_field_id = None;
__protocol.read_struct_begin()?;
if let ::std::result::Result::Err(mut err) = (|| {
loop {
let field_ident = __protocol.read_field_begin()?;
if field_ident.field_type == ::pilota::thrift::TType::Stop {
__protocol.field_stop_len();
break;
} else {
__protocol.field_begin_len(field_ident.field_type, field_ident.id);
}
__pilota_decoding_field_id = field_ident.id;
match field_ident.id {
Some(1) if field_ident.field_type == ::pilota::thrift::TType::Struct => {
var_1 = Some(::pilota::thrift::Message::decode(__protocol)?);
}
_ => {
__protocol.skip(field_ident.field_type)?;
}
}
__protocol.read_field_end()?;
__protocol.field_end_len();
}
::std::result::Result::Ok::<_, ::pilota::thrift::ThriftException>(())
})() {
if let Some(field_id) = __pilota_decoding_field_id {
err.prepend_msg(&format!("decode struct `ThriftHiveMetastoreLockArgsRecv` field(#{}) failed, caused by: ", field_id));
}
return ::std::result::Result::Err(err);
};
__protocol.read_struct_end()?;
let Some(var_1) = var_1 else {
return ::std::result::Result::Err(::pilota::thrift::new_protocol_exception(
::pilota::thrift::ProtocolExceptionKind::InvalidData,
"field rqst is required".to_string(),
));
};
let data = Self { rqst: var_1 };
::std::result::Result::Ok(data)
}
fn decode_async<'a, T: ::pilota::thrift::TAsyncInputProtocol>(
__protocol: &'a mut T,
) -> ::std::pin::Pin<
::std::boxed::Box<
dyn ::std::future::Future<
Output = ::std::result::Result<Self, ::pilota::thrift::ThriftException>,
> + Send
+ 'a,
>,
> {
::std::boxed::Box::pin(async move {
let mut var_1 = None;
let mut __pilota_decoding_field_id = None;
__protocol.read_struct_begin().await?;
if let ::std::result::Result::Err(mut err) = async {
loop {
let field_ident = __protocol.read_field_begin().await?;
if field_ident.field_type == ::pilota::thrift::TType::Stop {
break;
} else {
}
__pilota_decoding_field_id = field_ident.id;
match field_ident.id {
Some(1) if field_ident.field_type == ::pilota::thrift::TType::Struct => {
var_1 = Some(
<LockRequest as ::pilota::thrift::Message>::decode_async(
__protocol,
)
.await?,
);
}
_ => {
__protocol.skip(field_ident.field_type).await?;
}
}
__protocol.read_field_end().await?;
}
::std::result::Result::Ok::<_, ::pilota::thrift::ThriftException>(())
}
.await
{
if let Some(field_id) = __pilota_decoding_field_id {
err.prepend_msg(&format!("decode struct `ThriftHiveMetastoreLockArgsRecv` field(#{}) failed, caused by: ", field_id));
}
return ::std::result::Result::Err(err);
};
__protocol.read_struct_end().await?;
let Some(var_1) = var_1 else {
return ::std::result::Result::Err(::pilota::thrift::new_protocol_exception(
::pilota::thrift::ProtocolExceptionKind::InvalidData,
"field rqst is required".to_string(),
));
};
let data = Self { rqst: var_1 };
::std::result::Result::Ok(data)
})
}
fn size<T: ::pilota::thrift::TLengthProtocol>(&self, __protocol: &mut T) -> usize {
#[allow(unused_imports)]
use ::pilota::thrift::TLengthProtocolExt;
__protocol.struct_begin_len(&::pilota::thrift::TStructIdentifier {
name: "ThriftHiveMetastoreLockArgsRecv",
}) + __protocol.struct_field_len(Some(1), &self.rqst)
+ __protocol.field_stop_len()
+ __protocol.struct_end_len()
}
}