rustyspanner 0.1.1

A RPC Spanner Client for Rust
// This file is generated by rust-protobuf 2.0.2. Do not edit
// @generated

// https://github.com/Manishearth/rust-clippy/issues/702
#![allow(unknown_lints)]
#![allow(clippy)]

#![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(unsafe_code)]
#![allow(unused_imports)]
#![allow(unused_results)]

use protobuf::Message as Message_imported_for_functions;
use protobuf::ProtobufEnum as ProtobufEnum_imported_for_functions;

#[derive(PartialEq,Clone,Default)]
pub struct HttpBody {
    // message fields
    pub content_type: ::std::string::String,
    pub data: ::std::vec::Vec<u8>,
    // special fields
    unknown_fields: ::protobuf::UnknownFields,
    cached_size: ::protobuf::CachedSize,
}

impl HttpBody {
    pub fn new() -> HttpBody {
        ::std::default::Default::default()
    }

    // string content_type = 1;

    pub fn clear_content_type(&mut self) {
        self.content_type.clear();
    }

    // Param is passed by value, moved
    pub fn set_content_type(&mut self, v: ::std::string::String) {
        self.content_type = v;
    }

    // Mutable pointer to the field.
    // If field is not initialized, it is initialized with default value first.
    pub fn mut_content_type(&mut self) -> &mut ::std::string::String {
        &mut self.content_type
    }

    // Take field
    pub fn take_content_type(&mut self) -> ::std::string::String {
        ::std::mem::replace(&mut self.content_type, ::std::string::String::new())
    }

    pub fn get_content_type(&self) -> &str {
        &self.content_type
    }

    // bytes data = 2;

    pub fn clear_data(&mut self) {
        self.data.clear();
    }

    // Param is passed by value, moved
    pub fn set_data(&mut self, v: ::std::vec::Vec<u8>) {
        self.data = v;
    }

    // Mutable pointer to the field.
    // If field is not initialized, it is initialized with default value first.
    pub fn mut_data(&mut self) -> &mut ::std::vec::Vec<u8> {
        &mut self.data
    }

    // Take field
    pub fn take_data(&mut self) -> ::std::vec::Vec<u8> {
        ::std::mem::replace(&mut self.data, ::std::vec::Vec::new())
    }

    pub fn get_data(&self) -> &[u8] {
        &self.data
    }
}

impl ::protobuf::Message for HttpBody {
    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 => {
                    ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.content_type)?;
                },
                2 => {
                    ::protobuf::rt::read_singular_proto3_bytes_into(wire_type, is, &mut self.data)?;
                },
                _ => {
                    ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
                },
            };
        }
        ::std::result::Result::Ok(())
    }

    // Compute sizes of nested messages
    #[allow(unused_variables)]
    fn compute_size(&self) -> u32 {
        let mut my_size = 0;
        if !self.content_type.is_empty() {
            my_size += ::protobuf::rt::string_size(1, &self.content_type);
        }
        if !self.data.is_empty() {
            my_size += ::protobuf::rt::bytes_size(2, &self.data);
        }
        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.content_type.is_empty() {
            os.write_string(1, &self.content_type)?;
        }
        if !self.data.is_empty() {
            os.write_bytes(2, &self.data)?;
        }
        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) -> &::std::any::Any {
        self as &::std::any::Any
    }
    fn as_any_mut(&mut self) -> &mut ::std::any::Any {
        self as &mut ::std::any::Any
    }
    fn into_any(self: Box<Self>) -> ::std::boxed::Box<::std::any::Any> {
        self
    }

    fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
        Self::descriptor_static()
    }

    fn new() -> HttpBody {
        HttpBody::new()
    }

    fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
        static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
            lock: ::protobuf::lazy::ONCE_INIT,
            ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
        };
        unsafe {
            descriptor.get(|| {
                let mut fields = ::std::vec::Vec::new();
                fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
                    "content_type",
                    |m: &HttpBody| { &m.content_type },
                    |m: &mut HttpBody| { &mut m.content_type },
                ));
                fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>(
                    "data",
                    |m: &HttpBody| { &m.data },
                    |m: &mut HttpBody| { &mut m.data },
                ));
                ::protobuf::reflect::MessageDescriptor::new::<HttpBody>(
                    "HttpBody",
                    fields,
                    file_descriptor_proto()
                )
            })
        }
    }

    fn default_instance() -> &'static HttpBody {
        static mut instance: ::protobuf::lazy::Lazy<HttpBody> = ::protobuf::lazy::Lazy {
            lock: ::protobuf::lazy::ONCE_INIT,
            ptr: 0 as *const HttpBody,
        };
        unsafe {
            instance.get(HttpBody::new)
        }
    }
}

impl ::protobuf::Clear for HttpBody {
    fn clear(&mut self) {
        self.clear_content_type();
        self.clear_data();
        self.unknown_fields.clear();
    }
}

impl ::std::fmt::Debug for HttpBody {
    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
        ::protobuf::text_format::fmt(self, f)
    }
}

impl ::protobuf::reflect::ProtobufValue for HttpBody {
    fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
        ::protobuf::reflect::ProtobufValueRef::Message(self)
    }
}

static file_descriptor_proto_data: &'static [u8] = b"\
    \n\x19google/api/httpbody.proto\x12\ngoogle.api\"A\n\x08HttpBody\x12!\n\
    \x0ccontent_type\x18\x01\x20\x01(\tR\x0bcontentType\x12\x12\n\x04data\
    \x18\x02\x20\x01(\x0cR\x04dataBe\n\x0ecom.google.apiB\rHttpBodyProtoP\
    \x01Z;google.golang.org/genproto/googleapis/api/httpbody;httpbody\xa2\
    \x02\x04GAPIJ\x89\x14\n\x06\x12\x04\x0e\0E\x01\n\xbd\x04\n\x01\x0c\x12\
    \x03\x0e\0\x122\xb2\x04\x20Copyright\x202017\x20Google\x20Inc.\n\n\x20Li\
    censed\x20under\x20the\x20Apache\x20License,\x20Version\x202.0\x20(the\
    \x20\"License\");\n\x20you\x20may\x20not\x20use\x20this\x20file\x20excep\
    t\x20in\x20compliance\x20with\x20the\x20License.\n\x20You\x20may\x20obta\
    in\x20a\x20copy\x20of\x20the\x20License\x20at\n\n\x20\x20\x20\x20\x20htt\
    p://www.apache.org/licenses/LICENSE-2.0\n\n\x20Unless\x20required\x20by\
    \x20applicable\x20law\x20or\x20agreed\x20to\x20in\x20writing,\x20softwar\
    e\n\x20distributed\x20under\x20the\x20License\x20is\x20distributed\x20on\
    \x20an\x20\"AS\x20IS\"\x20BASIS,\n\x20WITHOUT\x20WARRANTIES\x20OR\x20CON\
    DITIONS\x20OF\x20ANY\x20KIND,\x20either\x20express\x20or\x20implied.\n\
    \x20See\x20the\x20License\x20for\x20the\x20specific\x20language\x20gover\
    ning\x20permissions\x20and\n\x20limitations\x20under\x20the\x20License.\
    \n\n\x08\n\x01\x02\x12\x03\x10\x08\x12\n\x08\n\x01\x08\x12\x03\x12\0R\n\
    \x0b\n\x04\x08\xe7\x07\0\x12\x03\x12\0R\n\x0c\n\x05\x08\xe7\x07\0\x02\
    \x12\x03\x12\x07\x11\n\r\n\x06\x08\xe7\x07\0\x02\0\x12\x03\x12\x07\x11\n\
    \x0e\n\x07\x08\xe7\x07\0\x02\0\x01\x12\x03\x12\x07\x11\n\x0c\n\x05\x08\
    \xe7\x07\0\x07\x12\x03\x12\x14Q\n\x08\n\x01\x08\x12\x03\x13\0\"\n\x0b\n\
    \x04\x08\xe7\x07\x01\x12\x03\x13\0\"\n\x0c\n\x05\x08\xe7\x07\x01\x02\x12\
    \x03\x13\x07\x1a\n\r\n\x06\x08\xe7\x07\x01\x02\0\x12\x03\x13\x07\x1a\n\
    \x0e\n\x07\x08\xe7\x07\x01\x02\0\x01\x12\x03\x13\x07\x1a\n\x0c\n\x05\x08\
    \xe7\x07\x01\x03\x12\x03\x13\x1d!\n\x08\n\x01\x08\x12\x03\x14\0.\n\x0b\n\
    \x04\x08\xe7\x07\x02\x12\x03\x14\0.\n\x0c\n\x05\x08\xe7\x07\x02\x02\x12\
    \x03\x14\x07\x1b\n\r\n\x06\x08\xe7\x07\x02\x02\0\x12\x03\x14\x07\x1b\n\
    \x0e\n\x07\x08\xe7\x07\x02\x02\0\x01\x12\x03\x14\x07\x1b\n\x0c\n\x05\x08\
    \xe7\x07\x02\x07\x12\x03\x14\x1e-\n\x08\n\x01\x08\x12\x03\x15\0'\n\x0b\n\
    \x04\x08\xe7\x07\x03\x12\x03\x15\0'\n\x0c\n\x05\x08\xe7\x07\x03\x02\x12\
    \x03\x15\x07\x13\n\r\n\x06\x08\xe7\x07\x03\x02\0\x12\x03\x15\x07\x13\n\
    \x0e\n\x07\x08\xe7\x07\x03\x02\0\x01\x12\x03\x15\x07\x13\n\x0c\n\x05\x08\
    \xe7\x07\x03\x07\x12\x03\x15\x16&\n\x08\n\x01\x08\x12\x03\x16\0\"\n\x0b\
    \n\x04\x08\xe7\x07\x04\x12\x03\x16\0\"\n\x0c\n\x05\x08\xe7\x07\x04\x02\
    \x12\x03\x16\x07\x18\n\r\n\x06\x08\xe7\x07\x04\x02\0\x12\x03\x16\x07\x18\
    \n\x0e\n\x07\x08\xe7\x07\x04\x02\0\x01\x12\x03\x16\x07\x18\n\x0c\n\x05\
    \x08\xe7\x07\x04\x07\x12\x03\x16\x1b!\n\x9d\n\n\x02\x04\0\x12\x04?\0E\
    \x01\x1a\x90\n\x20Message\x20that\x20represents\x20an\x20arbitrary\x20HT\
    TP\x20body.\x20It\x20should\x20only\x20be\x20used\x20for\n\x20payload\
    \x20formats\x20that\x20can't\x20be\x20represented\x20as\x20JSON,\x20such\
    \x20as\x20raw\x20binary\x20or\n\x20an\x20HTML\x20page.\n\n\n\x20This\x20\
    message\x20can\x20be\x20used\x20both\x20in\x20streaming\x20and\x20non-st\
    reaming\x20API\x20methods\x20in\n\x20the\x20request\x20as\x20well\x20as\
    \x20the\x20response.\n\n\x20It\x20can\x20be\x20used\x20as\x20a\x20top-le\
    vel\x20request\x20field,\x20which\x20is\x20convenient\x20if\x20one\n\x20\
    wants\x20to\x20extract\x20parameters\x20from\x20either\x20the\x20URL\x20\
    or\x20HTTP\x20template\x20into\x20the\n\x20request\x20fields\x20and\x20a\
    lso\x20want\x20access\x20to\x20the\x20raw\x20HTTP\x20body.\n\n\x20Exampl\
    e:\n\n\x20\x20\x20\x20\x20message\x20GetResourceRequest\x20{\n\x20\x20\
    \x20\x20\x20\x20\x20//\x20A\x20unique\x20request\x20id.\n\x20\x20\x20\
    \x20\x20\x20\x20string\x20request_id\x20=\x201;\n\n\x20\x20\x20\x20\x20\
    \x20\x20//\x20The\x20raw\x20HTTP\x20body\x20is\x20bound\x20to\x20this\
    \x20field.\n\x20\x20\x20\x20\x20\x20\x20google.api.HttpBody\x20http_body\
    \x20=\x202;\n\x20\x20\x20\x20\x20}\n\n\x20\x20\x20\x20\x20service\x20Res\
    ourceService\x20{\n\x20\x20\x20\x20\x20\x20\x20rpc\x20GetResource(GetRes\
    ourceRequest)\x20returns\x20(google.api.HttpBody);\n\x20\x20\x20\x20\x20\
    \x20\x20rpc\x20UpdateResource(google.api.HttpBody)\x20returns\x20(google\
    .protobuf.Empty);\n\x20\x20\x20\x20\x20}\n\n\x20Example\x20with\x20strea\
    ming\x20methods:\n\n\x20\x20\x20\x20\x20service\x20CaldavService\x20{\n\
    \x20\x20\x20\x20\x20\x20\x20rpc\x20GetCalendar(stream\x20google.api.Http\
    Body)\n\x20\x20\x20\x20\x20\x20\x20\x20\x20returns\x20(stream\x20google.\
    api.HttpBody);\n\x20\x20\x20\x20\x20\x20\x20rpc\x20UpdateCalendar(stream\
    \x20google.api.HttpBody)\n\x20\x20\x20\x20\x20\x20\x20\x20\x20returns\
    \x20(stream\x20google.api.HttpBody);\n\x20\x20\x20\x20\x20}\n\n\x20Use\
    \x20of\x20this\x20type\x20only\x20changes\x20how\x20the\x20request\x20an\
    d\x20response\x20bodies\x20are\n\x20handled,\x20all\x20other\x20features\
    \x20will\x20continue\x20to\x20work\x20unchanged.\n\n\n\n\x03\x04\0\x01\
    \x12\x03?\x08\x10\nV\n\x04\x04\0\x02\0\x12\x03A\x02\x1a\x1aI\x20The\x20H\
    TTP\x20Content-Type\x20string\x20representing\x20the\x20content\x20type\
    \x20of\x20the\x20body.\n\n\r\n\x05\x04\0\x02\0\x04\x12\x04A\x02?\x12\n\
    \x0c\n\x05\x04\0\x02\0\x05\x12\x03A\x02\x08\n\x0c\n\x05\x04\0\x02\0\x01\
    \x12\x03A\t\x15\n\x0c\n\x05\x04\0\x02\0\x03\x12\x03A\x18\x19\n%\n\x04\
    \x04\0\x02\x01\x12\x03D\x02\x11\x1a\x18\x20HTTP\x20body\x20binary\x20dat\
    a.\n\n\r\n\x05\x04\0\x02\x01\x04\x12\x04D\x02A\x1a\n\x0c\n\x05\x04\0\x02\
    \x01\x05\x12\x03D\x02\x07\n\x0c\n\x05\x04\0\x02\x01\x01\x12\x03D\x08\x0c\
    \n\x0c\n\x05\x04\0\x02\x01\x03\x12\x03D\x0f\x10b\x06proto3\
";

static mut file_descriptor_proto_lazy: ::protobuf::lazy::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::lazy::Lazy {
    lock: ::protobuf::lazy::ONCE_INIT,
    ptr: 0 as *const ::protobuf::descriptor::FileDescriptorProto,
};

fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto {
    ::protobuf::parse_from_bytes(file_descriptor_proto_data).unwrap()
}

pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto {
    unsafe {
        file_descriptor_proto_lazy.get(|| {
            parse_descriptor_proto()
        })
    }
}