#![allow(unknown_lints)]
#![allow(clippy::all)]
#![allow(unused_attributes)]
#![cfg_attr(rustfmt, rustfmt::skip)]
#![allow(box_pointers)]
#![allow(dead_code)]
#![allow(missing_docs)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
#![allow(non_upper_case_globals)]
#![allow(trivial_casts)]
#![allow(unused_imports)]
#![allow(unused_results)]
#[derive(PartialEq,Clone,Default)]
#[cfg_attr(feature = "with-serde", derive(::serde::Serialize, ::serde::Deserialize))]
pub struct Request {
pub seqid: i32,
pub method: Method,
pub uri: ::std::string::String,
pub headers: ::std::collections::HashMap<::std::string::String, ::std::string::String>,
pub body: ::bytes::Bytes,
#[cfg_attr(feature = "with-serde", serde(skip))]
pub unknown_fields: ::protobuf::UnknownFields,
#[cfg_attr(feature = "with-serde", serde(skip))]
pub cached_size: ::protobuf::CachedSize,
}
impl<'a> ::std::default::Default for &'a Request {
fn default() -> &'a Request {
<Request as ::protobuf::Message>::default_instance()
}
}
impl Request {
pub fn new() -> Request {
::std::default::Default::default()
}
pub fn get_seqid(&self) -> i32 {
self.seqid
}
pub fn clear_seqid(&mut self) {
self.seqid = 0;
}
pub fn set_seqid(&mut self, v: i32) {
self.seqid = v;
}
pub fn get_method(&self) -> Method {
self.method
}
pub fn clear_method(&mut self) {
self.method = Method::GET;
}
pub fn set_method(&mut self, v: Method) {
self.method = v;
}
pub fn get_uri(&self) -> &str {
&self.uri
}
pub fn clear_uri(&mut self) {
self.uri.clear();
}
pub fn set_uri(&mut self, v: ::std::string::String) {
self.uri = v;
}
pub fn mut_uri(&mut self) -> &mut ::std::string::String {
&mut self.uri
}
pub fn take_uri(&mut self) -> ::std::string::String {
::std::mem::replace(&mut self.uri, ::std::string::String::new())
}
pub fn get_headers(&self) -> &::std::collections::HashMap<::std::string::String, ::std::string::String> {
&self.headers
}
pub fn clear_headers(&mut self) {
self.headers.clear();
}
pub fn set_headers(&mut self, v: ::std::collections::HashMap<::std::string::String, ::std::string::String>) {
self.headers = v;
}
pub fn mut_headers(&mut self) -> &mut ::std::collections::HashMap<::std::string::String, ::std::string::String> {
&mut self.headers
}
pub fn take_headers(&mut self) -> ::std::collections::HashMap<::std::string::String, ::std::string::String> {
::std::mem::replace(&mut self.headers, ::std::collections::HashMap::new())
}
pub fn get_body(&self) -> &[u8] {
&self.body
}
pub fn clear_body(&mut self) {
self.body.clear();
}
pub fn set_body(&mut self, v: ::bytes::Bytes) {
self.body = v;
}
pub fn mut_body(&mut self) -> &mut ::bytes::Bytes {
&mut self.body
}
pub fn take_body(&mut self) -> ::bytes::Bytes {
::std::mem::replace(&mut self.body, ::bytes::Bytes::new())
}
}
impl ::protobuf::Message for Request {
fn is_initialized(&self) -> bool {
true
}
fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
while !is.eof()? {
let (field_number, wire_type) = is.read_tag_unpack()?;
match field_number {
1 => {
if wire_type != ::protobuf::wire_format::WireTypeVarint {
return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
}
let tmp = is.read_int32()?;
self.seqid = tmp;
},
2 => {
::protobuf::rt::read_proto3_enum_with_unknown_fields_into(wire_type, is, &mut self.method, 2, &mut self.unknown_fields)?
},
3 => {
::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.uri)?;
},
4 => {
::protobuf::rt::read_map_into::<::protobuf::types::ProtobufTypeString, ::protobuf::types::ProtobufTypeString>(wire_type, is, &mut self.headers)?;
},
5 => {
::protobuf::rt::read_singular_proto3_carllerche_bytes_into(wire_type, is, &mut self.body)?;
},
_ => {
::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
},
};
}
::std::result::Result::Ok(())
}
#[allow(unused_variables)]
fn compute_size(&self) -> u32 {
let mut my_size = 0;
if self.seqid != 0 {
my_size += ::protobuf::rt::value_size(1, self.seqid, ::protobuf::wire_format::WireTypeVarint);
}
if self.method != Method::GET {
my_size += ::protobuf::rt::enum_size(2, self.method);
}
if !self.uri.is_empty() {
my_size += ::protobuf::rt::string_size(3, &self.uri);
}
my_size += ::protobuf::rt::compute_map_size::<::protobuf::types::ProtobufTypeString, ::protobuf::types::ProtobufTypeString>(4, &self.headers);
if !self.body.is_empty() {
my_size += ::protobuf::rt::bytes_size(5, &self.body);
}
my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
self.cached_size.set(my_size);
my_size
}
fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
if self.seqid != 0 {
os.write_int32(1, self.seqid)?;
}
if self.method != Method::GET {
os.write_enum(2, ::protobuf::ProtobufEnum::value(&self.method))?;
}
if !self.uri.is_empty() {
os.write_string(3, &self.uri)?;
}
::protobuf::rt::write_map_with_cached_sizes::<::protobuf::types::ProtobufTypeString, ::protobuf::types::ProtobufTypeString>(4, &self.headers, os)?;
if !self.body.is_empty() {
os.write_bytes(5, &self.body)?;
}
os.write_unknown_fields(self.get_unknown_fields())?;
::std::result::Result::Ok(())
}
fn get_cached_size(&self) -> u32 {
self.cached_size.get()
}
fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
&self.unknown_fields
}
fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
&mut self.unknown_fields
}
fn as_any(&self) -> &dyn (::std::any::Any) {
self as &dyn (::std::any::Any)
}
fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
self as &mut dyn (::std::any::Any)
}
fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
self
}
fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
Self::descriptor_static()
}
fn new() -> Request {
Request::new()
}
fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
descriptor.get(|| {
let mut fields = ::std::vec::Vec::new();
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt32>(
"seqid",
|m: &Request| { &m.seqid },
|m: &mut Request| { &mut m.seqid },
));
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeEnum<Method>>(
"method",
|m: &Request| { &m.method },
|m: &mut Request| { &mut m.method },
));
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
"uri",
|m: &Request| { &m.uri },
|m: &mut Request| { &mut m.uri },
));
fields.push(::protobuf::reflect::accessor::make_map_accessor::<_, ::protobuf::types::ProtobufTypeString, ::protobuf::types::ProtobufTypeString>(
"headers",
|m: &Request| { &m.headers },
|m: &mut Request| { &mut m.headers },
));
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeCarllercheBytes>(
"body",
|m: &Request| { &m.body },
|m: &mut Request| { &mut m.body },
));
::protobuf::reflect::MessageDescriptor::new_pb_name::<Request>(
"Request",
fields,
file_descriptor_proto()
)
})
}
fn default_instance() -> &'static Request {
static instance: ::protobuf::rt::LazyV2<Request> = ::protobuf::rt::LazyV2::INIT;
instance.get(Request::new)
}
}
impl ::protobuf::Clear for Request {
fn clear(&mut self) {
self.seqid = 0;
self.method = Method::GET;
self.uri.clear();
self.headers.clear();
self.body.clear();
self.unknown_fields.clear();
}
}
impl ::std::fmt::Debug for Request {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
::protobuf::text_format::fmt(self, f)
}
}
impl ::protobuf::reflect::ProtobufValue for Request {
fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
::protobuf::reflect::ReflectValueRef::Message(self)
}
}
#[derive(PartialEq,Clone,Default)]
#[cfg_attr(feature = "with-serde", derive(::serde::Serialize, ::serde::Deserialize))]
pub struct Response {
pub seqid: i32,
pub status: i32,
pub headers: ::std::collections::HashMap<::std::string::String, ::std::string::String>,
pub body: ::bytes::Bytes,
#[cfg_attr(feature = "with-serde", serde(skip))]
pub unknown_fields: ::protobuf::UnknownFields,
#[cfg_attr(feature = "with-serde", serde(skip))]
pub cached_size: ::protobuf::CachedSize,
}
impl<'a> ::std::default::Default for &'a Response {
fn default() -> &'a Response {
<Response as ::protobuf::Message>::default_instance()
}
}
impl Response {
pub fn new() -> Response {
::std::default::Default::default()
}
pub fn get_seqid(&self) -> i32 {
self.seqid
}
pub fn clear_seqid(&mut self) {
self.seqid = 0;
}
pub fn set_seqid(&mut self, v: i32) {
self.seqid = v;
}
pub fn get_status(&self) -> i32 {
self.status
}
pub fn clear_status(&mut self) {
self.status = 0;
}
pub fn set_status(&mut self, v: i32) {
self.status = v;
}
pub fn get_headers(&self) -> &::std::collections::HashMap<::std::string::String, ::std::string::String> {
&self.headers
}
pub fn clear_headers(&mut self) {
self.headers.clear();
}
pub fn set_headers(&mut self, v: ::std::collections::HashMap<::std::string::String, ::std::string::String>) {
self.headers = v;
}
pub fn mut_headers(&mut self) -> &mut ::std::collections::HashMap<::std::string::String, ::std::string::String> {
&mut self.headers
}
pub fn take_headers(&mut self) -> ::std::collections::HashMap<::std::string::String, ::std::string::String> {
::std::mem::replace(&mut self.headers, ::std::collections::HashMap::new())
}
pub fn get_body(&self) -> &[u8] {
&self.body
}
pub fn clear_body(&mut self) {
self.body.clear();
}
pub fn set_body(&mut self, v: ::bytes::Bytes) {
self.body = v;
}
pub fn mut_body(&mut self) -> &mut ::bytes::Bytes {
&mut self.body
}
pub fn take_body(&mut self) -> ::bytes::Bytes {
::std::mem::replace(&mut self.body, ::bytes::Bytes::new())
}
}
impl ::protobuf::Message for Response {
fn is_initialized(&self) -> bool {
true
}
fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
while !is.eof()? {
let (field_number, wire_type) = is.read_tag_unpack()?;
match field_number {
1 => {
if wire_type != ::protobuf::wire_format::WireTypeVarint {
return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
}
let tmp = is.read_int32()?;
self.seqid = tmp;
},
2 => {
if wire_type != ::protobuf::wire_format::WireTypeVarint {
return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
}
let tmp = is.read_int32()?;
self.status = tmp;
},
3 => {
::protobuf::rt::read_map_into::<::protobuf::types::ProtobufTypeString, ::protobuf::types::ProtobufTypeString>(wire_type, is, &mut self.headers)?;
},
4 => {
::protobuf::rt::read_singular_proto3_carllerche_bytes_into(wire_type, is, &mut self.body)?;
},
_ => {
::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
},
};
}
::std::result::Result::Ok(())
}
#[allow(unused_variables)]
fn compute_size(&self) -> u32 {
let mut my_size = 0;
if self.seqid != 0 {
my_size += ::protobuf::rt::value_size(1, self.seqid, ::protobuf::wire_format::WireTypeVarint);
}
if self.status != 0 {
my_size += ::protobuf::rt::value_size(2, self.status, ::protobuf::wire_format::WireTypeVarint);
}
my_size += ::protobuf::rt::compute_map_size::<::protobuf::types::ProtobufTypeString, ::protobuf::types::ProtobufTypeString>(3, &self.headers);
if !self.body.is_empty() {
my_size += ::protobuf::rt::bytes_size(4, &self.body);
}
my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
self.cached_size.set(my_size);
my_size
}
fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
if self.seqid != 0 {
os.write_int32(1, self.seqid)?;
}
if self.status != 0 {
os.write_int32(2, self.status)?;
}
::protobuf::rt::write_map_with_cached_sizes::<::protobuf::types::ProtobufTypeString, ::protobuf::types::ProtobufTypeString>(3, &self.headers, os)?;
if !self.body.is_empty() {
os.write_bytes(4, &self.body)?;
}
os.write_unknown_fields(self.get_unknown_fields())?;
::std::result::Result::Ok(())
}
fn get_cached_size(&self) -> u32 {
self.cached_size.get()
}
fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
&self.unknown_fields
}
fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
&mut self.unknown_fields
}
fn as_any(&self) -> &dyn (::std::any::Any) {
self as &dyn (::std::any::Any)
}
fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
self as &mut dyn (::std::any::Any)
}
fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
self
}
fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
Self::descriptor_static()
}
fn new() -> Response {
Response::new()
}
fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
descriptor.get(|| {
let mut fields = ::std::vec::Vec::new();
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt32>(
"seqid",
|m: &Response| { &m.seqid },
|m: &mut Response| { &mut m.seqid },
));
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt32>(
"status",
|m: &Response| { &m.status },
|m: &mut Response| { &mut m.status },
));
fields.push(::protobuf::reflect::accessor::make_map_accessor::<_, ::protobuf::types::ProtobufTypeString, ::protobuf::types::ProtobufTypeString>(
"headers",
|m: &Response| { &m.headers },
|m: &mut Response| { &mut m.headers },
));
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeCarllercheBytes>(
"body",
|m: &Response| { &m.body },
|m: &mut Response| { &mut m.body },
));
::protobuf::reflect::MessageDescriptor::new_pb_name::<Response>(
"Response",
fields,
file_descriptor_proto()
)
})
}
fn default_instance() -> &'static Response {
static instance: ::protobuf::rt::LazyV2<Response> = ::protobuf::rt::LazyV2::INIT;
instance.get(Response::new)
}
}
impl ::protobuf::Clear for Response {
fn clear(&mut self) {
self.seqid = 0;
self.status = 0;
self.headers.clear();
self.body.clear();
self.unknown_fields.clear();
}
}
impl ::std::fmt::Debug for Response {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
::protobuf::text_format::fmt(self, f)
}
}
impl ::protobuf::reflect::ProtobufValue for Response {
fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
::protobuf::reflect::ReflectValueRef::Message(self)
}
}
#[derive(Clone,PartialEq,Eq,Debug,Hash)]
#[cfg_attr(feature = "with-serde", derive(::serde::Serialize, ::serde::Deserialize))]
pub enum Scheme {
HTTP = 0,
HTTPS = 1,
RPC = 2,
WNS = 3,
}
impl ::protobuf::ProtobufEnum for Scheme {
fn value(&self) -> i32 {
*self as i32
}
fn from_i32(value: i32) -> ::std::option::Option<Scheme> {
match value {
0 => ::std::option::Option::Some(Scheme::HTTP),
1 => ::std::option::Option::Some(Scheme::HTTPS),
2 => ::std::option::Option::Some(Scheme::RPC),
3 => ::std::option::Option::Some(Scheme::WNS),
_ => ::std::option::Option::None
}
}
fn values() -> &'static [Self] {
static values: &'static [Scheme] = &[
Scheme::HTTP,
Scheme::HTTPS,
Scheme::RPC,
Scheme::WNS,
];
values
}
fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor {
static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::EnumDescriptor> = ::protobuf::rt::LazyV2::INIT;
descriptor.get(|| {
::protobuf::reflect::EnumDescriptor::new_pb_name::<Scheme>("Scheme", file_descriptor_proto())
})
}
}
impl ::std::marker::Copy for Scheme {
}
impl ::std::default::Default for Scheme {
fn default() -> Self {
Scheme::HTTP
}
}
impl ::protobuf::reflect::ProtobufValue for Scheme {
fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
::protobuf::reflect::ReflectValueRef::Enum(::protobuf::ProtobufEnum::descriptor(self))
}
}
#[derive(Clone,PartialEq,Eq,Debug,Hash)]
#[cfg_attr(feature = "with-serde", derive(::serde::Serialize, ::serde::Deserialize))]
pub enum Method {
GET = 0,
HEAD = 1,
POST = 2,
PUT = 3,
DELETE = 4,
CONNECT = 5,
OPTIONS = 6,
TRACE = 7,
PATCH = 8,
ONEWAY = 9,
}
impl ::protobuf::ProtobufEnum for Method {
fn value(&self) -> i32 {
*self as i32
}
fn from_i32(value: i32) -> ::std::option::Option<Method> {
match value {
0 => ::std::option::Option::Some(Method::GET),
1 => ::std::option::Option::Some(Method::HEAD),
2 => ::std::option::Option::Some(Method::POST),
3 => ::std::option::Option::Some(Method::PUT),
4 => ::std::option::Option::Some(Method::DELETE),
5 => ::std::option::Option::Some(Method::CONNECT),
6 => ::std::option::Option::Some(Method::OPTIONS),
7 => ::std::option::Option::Some(Method::TRACE),
8 => ::std::option::Option::Some(Method::PATCH),
9 => ::std::option::Option::Some(Method::ONEWAY),
_ => ::std::option::Option::None
}
}
fn values() -> &'static [Self] {
static values: &'static [Method] = &[
Method::GET,
Method::HEAD,
Method::POST,
Method::PUT,
Method::DELETE,
Method::CONNECT,
Method::OPTIONS,
Method::TRACE,
Method::PATCH,
Method::ONEWAY,
];
values
}
fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor {
static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::EnumDescriptor> = ::protobuf::rt::LazyV2::INIT;
descriptor.get(|| {
::protobuf::reflect::EnumDescriptor::new_pb_name::<Method>("Method", file_descriptor_proto())
})
}
}
impl ::std::marker::Copy for Method {
}
impl ::std::default::Default for Method {
fn default() -> Self {
Method::GET
}
}
impl ::protobuf::reflect::ProtobufValue for Method {
fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
::protobuf::reflect::ReflectValueRef::Enum(::protobuf::ProtobufEnum::descriptor(self))
}
}
static file_descriptor_proto_data: &'static [u8] = b"\
\n\rmessage.proto\"\xd3\x01\n\x07Request\x12\x14\n\x05seqid\x18\x01\x20\
\x01(\x05R\x05seqid\x12\x1f\n\x06method\x18\x02\x20\x01(\x0e2\x07.Method\
R\x06method\x12\x10\n\x03uri\x18\x03\x20\x01(\tR\x03uri\x12/\n\x07header\
s\x18\x04\x20\x03(\x0b2\x15.Request.HeadersEntryR\x07headers\x12\x12\n\
\x04body\x18\x05\x20\x01(\x0cR\x04body\x1a:\n\x0cHeadersEntry\x12\x10\n\
\x03key\x18\x01\x20\x01(\tR\x03key\x12\x14\n\x05value\x18\x02\x20\x01(\t\
R\x05value:\x028\x01\"\xba\x01\n\x08Response\x12\x14\n\x05seqid\x18\x01\
\x20\x01(\x05R\x05seqid\x12\x16\n\x06status\x18\x02\x20\x01(\x05R\x06sta\
tus\x120\n\x07headers\x18\x03\x20\x03(\x0b2\x16.Response.HeadersEntryR\
\x07headers\x12\x12\n\x04body\x18\x04\x20\x01(\x0cR\x04body\x1a:\n\x0cHe\
adersEntry\x12\x10\n\x03key\x18\x01\x20\x01(\tR\x03key\x12\x14\n\x05valu\
e\x18\x02\x20\x01(\tR\x05value:\x028\x01*/\n\x06Scheme\x12\x08\n\x04HTTP\
\x10\0\x12\t\n\x05HTTPS\x10\x01\x12\x07\n\x03RPC\x10\x02\x12\x07\n\x03WN\
S\x10\x03*v\n\x06Method\x12\x07\n\x03GET\x10\0\x12\x08\n\x04HEAD\x10\x01\
\x12\x08\n\x04POST\x10\x02\x12\x07\n\x03PUT\x10\x03\x12\n\n\x06DELETE\
\x10\x04\x12\x0b\n\x07CONNECT\x10\x05\x12\x0b\n\x07OPTIONS\x10\x06\x12\t\
\n\x05TRACE\x10\x07\x12\t\n\x05PATCH\x10\x08\x12\n\n\x06ONEWAY\x10\tb\
\x06proto3\
";
static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;
fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto {
::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap()
}
pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto {
file_descriptor_proto_lazy.get(|| {
parse_descriptor_proto()
})
}