|
| 1 | +// Automatically generated rust module for 'data_object.proto' file |
| 2 | + |
| 3 | +#![allow(non_snake_case)] |
| 4 | +#![allow(non_upper_case_globals)] |
| 5 | +#![allow(non_camel_case_types)] |
| 6 | +#![allow(unused_imports)] |
| 7 | +#![allow(unknown_lints)] |
| 8 | +#![allow(clippy::all)] |
| 9 | +#![cfg_attr(rustfmt, rustfmt_skip)] |
| 10 | + |
| 11 | + |
| 12 | +use std::borrow::Cow; |
| 13 | +use quick_protobuf::{MessageInfo, MessageRead, MessageWrite, BytesReader, Writer, WriterBackend, Result}; |
| 14 | +use quick_protobuf::sizeofs::*; |
| 15 | +use super::*; |
| 16 | + |
| 17 | +#[allow(clippy::derive_partial_eq_without_eq)] |
| 18 | +#[derive(Debug, Default, PartialEq, Clone)] |
| 19 | +pub struct McpServerDo<'a> { |
| 20 | + pub id: u64, |
| 21 | + pub namespace: Cow<'a, str>, |
| 22 | + pub name: Cow<'a, str>, |
| 23 | + pub description: Cow<'a, str>, |
| 24 | + pub token: Cow<'a, str>, |
| 25 | +} |
| 26 | + |
| 27 | +impl<'a> MessageRead<'a> for McpServerDo<'a> { |
| 28 | + fn from_reader(r: &mut BytesReader, bytes: &'a [u8]) -> Result<Self> { |
| 29 | + let mut msg = Self::default(); |
| 30 | + while !r.is_eof() { |
| 31 | + match r.next_tag(bytes) { |
| 32 | + Ok(8) => msg.id = r.read_uint64(bytes)?, |
| 33 | + Ok(18) => msg.namespace = r.read_string(bytes).map(Cow::Borrowed)?, |
| 34 | + Ok(26) => msg.name = r.read_string(bytes).map(Cow::Borrowed)?, |
| 35 | + Ok(34) => msg.description = r.read_string(bytes).map(Cow::Borrowed)?, |
| 36 | + Ok(42) => msg.token = r.read_string(bytes).map(Cow::Borrowed)?, |
| 37 | + Ok(t) => { r.read_unknown(bytes, t)?; } |
| 38 | + Err(e) => return Err(e), |
| 39 | + } |
| 40 | + } |
| 41 | + Ok(msg) |
| 42 | + } |
| 43 | +} |
| 44 | + |
| 45 | +impl<'a> MessageWrite for McpServerDo<'a> { |
| 46 | + fn get_size(&self) -> usize { |
| 47 | + 0 |
| 48 | + + if self.id == 0u64 { 0 } else { 1 + sizeof_varint(*(&self.id) as u64) } |
| 49 | + + if self.namespace == "" { 0 } else { 1 + sizeof_len((&self.namespace).len()) } |
| 50 | + + if self.name == "" { 0 } else { 1 + sizeof_len((&self.name).len()) } |
| 51 | + + if self.description == "" { 0 } else { 1 + sizeof_len((&self.description).len()) } |
| 52 | + + if self.token == "" { 0 } else { 1 + sizeof_len((&self.token).len()) } |
| 53 | + } |
| 54 | + |
| 55 | + fn write_message<W: WriterBackend>(&self, w: &mut Writer<W>) -> Result<()> { |
| 56 | + if self.id != 0u64 { w.write_with_tag(8, |w| w.write_uint64(*&self.id))?; } |
| 57 | + if self.namespace != "" { w.write_with_tag(18, |w| w.write_string(&**&self.namespace))?; } |
| 58 | + if self.name != "" { w.write_with_tag(26, |w| w.write_string(&**&self.name))?; } |
| 59 | + if self.description != "" { w.write_with_tag(34, |w| w.write_string(&**&self.description))?; } |
| 60 | + if self.token != "" { w.write_with_tag(42, |w| w.write_string(&**&self.token))?; } |
| 61 | + Ok(()) |
| 62 | + } |
| 63 | +} |
| 64 | + |
| 65 | +#[allow(clippy::derive_partial_eq_without_eq)] |
| 66 | +#[derive(Debug, Default, PartialEq, Clone)] |
| 67 | +pub struct McpToolSpecDo<'a> { |
| 68 | + pub namespace: Cow<'a, str>, |
| 69 | + pub group: Cow<'a, str>, |
| 70 | + pub tool_name: Cow<'a, str>, |
| 71 | + pub version: u64, |
| 72 | + pub name: Cow<'a, str>, |
| 73 | + pub description: Cow<'a, str>, |
| 74 | +} |
| 75 | + |
| 76 | +impl<'a> MessageRead<'a> for McpToolSpecDo<'a> { |
| 77 | + fn from_reader(r: &mut BytesReader, bytes: &'a [u8]) -> Result<Self> { |
| 78 | + let mut msg = Self::default(); |
| 79 | + while !r.is_eof() { |
| 80 | + match r.next_tag(bytes) { |
| 81 | + Ok(10) => msg.namespace = r.read_string(bytes).map(Cow::Borrowed)?, |
| 82 | + Ok(18) => msg.group = r.read_string(bytes).map(Cow::Borrowed)?, |
| 83 | + Ok(26) => msg.tool_name = r.read_string(bytes).map(Cow::Borrowed)?, |
| 84 | + Ok(32) => msg.version = r.read_uint64(bytes)?, |
| 85 | + Ok(42) => msg.name = r.read_string(bytes).map(Cow::Borrowed)?, |
| 86 | + Ok(50) => msg.description = r.read_string(bytes).map(Cow::Borrowed)?, |
| 87 | + Ok(t) => { r.read_unknown(bytes, t)?; } |
| 88 | + Err(e) => return Err(e), |
| 89 | + } |
| 90 | + } |
| 91 | + Ok(msg) |
| 92 | + } |
| 93 | +} |
| 94 | + |
| 95 | +impl<'a> MessageWrite for McpToolSpecDo<'a> { |
| 96 | + fn get_size(&self) -> usize { |
| 97 | + 0 |
| 98 | + + if self.namespace == "" { 0 } else { 1 + sizeof_len((&self.namespace).len()) } |
| 99 | + + if self.group == "" { 0 } else { 1 + sizeof_len((&self.group).len()) } |
| 100 | + + if self.tool_name == "" { 0 } else { 1 + sizeof_len((&self.tool_name).len()) } |
| 101 | + + if self.version == 0u64 { 0 } else { 1 + sizeof_varint(*(&self.version) as u64) } |
| 102 | + + if self.name == "" { 0 } else { 1 + sizeof_len((&self.name).len()) } |
| 103 | + + if self.description == "" { 0 } else { 1 + sizeof_len((&self.description).len()) } |
| 104 | + } |
| 105 | + |
| 106 | + fn write_message<W: WriterBackend>(&self, w: &mut Writer<W>) -> Result<()> { |
| 107 | + if self.namespace != "" { w.write_with_tag(10, |w| w.write_string(&**&self.namespace))?; } |
| 108 | + if self.group != "" { w.write_with_tag(18, |w| w.write_string(&**&self.group))?; } |
| 109 | + if self.tool_name != "" { w.write_with_tag(26, |w| w.write_string(&**&self.tool_name))?; } |
| 110 | + if self.version != 0u64 { w.write_with_tag(32, |w| w.write_uint64(*&self.version))?; } |
| 111 | + if self.name != "" { w.write_with_tag(42, |w| w.write_string(&**&self.name))?; } |
| 112 | + if self.description != "" { w.write_with_tag(50, |w| w.write_string(&**&self.description))?; } |
| 113 | + Ok(()) |
| 114 | + } |
| 115 | +} |
| 116 | + |
| 117 | +#[allow(clippy::derive_partial_eq_without_eq)] |
| 118 | +#[derive(Debug, Default, PartialEq, Clone)] |
| 119 | +pub struct McpToolDo<'a> { |
| 120 | + pub id: u64, |
| 121 | + pub tool_name: Cow<'a, str>, |
| 122 | + pub namespace: Cow<'a, str>, |
| 123 | + pub group: Cow<'a, str>, |
| 124 | + pub version: u64, |
| 125 | +} |
| 126 | + |
| 127 | +impl<'a> MessageRead<'a> for McpToolDo<'a> { |
| 128 | + fn from_reader(r: &mut BytesReader, bytes: &'a [u8]) -> Result<Self> { |
| 129 | + let mut msg = Self::default(); |
| 130 | + while !r.is_eof() { |
| 131 | + match r.next_tag(bytes) { |
| 132 | + Ok(8) => msg.id = r.read_uint64(bytes)?, |
| 133 | + Ok(18) => msg.tool_name = r.read_string(bytes).map(Cow::Borrowed)?, |
| 134 | + Ok(26) => msg.namespace = r.read_string(bytes).map(Cow::Borrowed)?, |
| 135 | + Ok(34) => msg.group = r.read_string(bytes).map(Cow::Borrowed)?, |
| 136 | + Ok(40) => msg.version = r.read_uint64(bytes)?, |
| 137 | + Ok(t) => { r.read_unknown(bytes, t)?; } |
| 138 | + Err(e) => return Err(e), |
| 139 | + } |
| 140 | + } |
| 141 | + Ok(msg) |
| 142 | + } |
| 143 | +} |
| 144 | + |
| 145 | +impl<'a> MessageWrite for McpToolDo<'a> { |
| 146 | + fn get_size(&self) -> usize { |
| 147 | + 0 |
| 148 | + + if self.id == 0u64 { 0 } else { 1 + sizeof_varint(*(&self.id) as u64) } |
| 149 | + + if self.tool_name == "" { 0 } else { 1 + sizeof_len((&self.tool_name).len()) } |
| 150 | + + if self.namespace == "" { 0 } else { 1 + sizeof_len((&self.namespace).len()) } |
| 151 | + + if self.group == "" { 0 } else { 1 + sizeof_len((&self.group).len()) } |
| 152 | + + if self.version == 0u64 { 0 } else { 1 + sizeof_varint(*(&self.version) as u64) } |
| 153 | + } |
| 154 | + |
| 155 | + fn write_message<W: WriterBackend>(&self, w: &mut Writer<W>) -> Result<()> { |
| 156 | + if self.id != 0u64 { w.write_with_tag(8, |w| w.write_uint64(*&self.id))?; } |
| 157 | + if self.tool_name != "" { w.write_with_tag(18, |w| w.write_string(&**&self.tool_name))?; } |
| 158 | + if self.namespace != "" { w.write_with_tag(26, |w| w.write_string(&**&self.namespace))?; } |
| 159 | + if self.group != "" { w.write_with_tag(34, |w| w.write_string(&**&self.group))?; } |
| 160 | + if self.version != 0u64 { w.write_with_tag(40, |w| w.write_uint64(*&self.version))?; } |
| 161 | + Ok(()) |
| 162 | + } |
| 163 | +} |
| 164 | + |
| 165 | +#[allow(clippy::derive_partial_eq_without_eq)] |
| 166 | +#[derive(Debug, Default, PartialEq, Clone)] |
| 167 | +pub struct ToolRouteRuleDo<'a> { |
| 168 | + pub protocol: Cow<'a, str>, |
| 169 | + pub url: Cow<'a, str>, |
| 170 | + pub method: Cow<'a, str>, |
| 171 | +} |
| 172 | + |
| 173 | +impl<'a> MessageRead<'a> for ToolRouteRuleDo<'a> { |
| 174 | + fn from_reader(r: &mut BytesReader, bytes: &'a [u8]) -> Result<Self> { |
| 175 | + let mut msg = Self::default(); |
| 176 | + while !r.is_eof() { |
| 177 | + match r.next_tag(bytes) { |
| 178 | + Ok(10) => msg.protocol = r.read_string(bytes).map(Cow::Borrowed)?, |
| 179 | + Ok(18) => msg.url = r.read_string(bytes).map(Cow::Borrowed)?, |
| 180 | + Ok(26) => msg.method = r.read_string(bytes).map(Cow::Borrowed)?, |
| 181 | + Ok(t) => { r.read_unknown(bytes, t)?; } |
| 182 | + Err(e) => return Err(e), |
| 183 | + } |
| 184 | + } |
| 185 | + Ok(msg) |
| 186 | + } |
| 187 | +} |
| 188 | + |
| 189 | +impl<'a> MessageWrite for ToolRouteRuleDo<'a> { |
| 190 | + fn get_size(&self) -> usize { |
| 191 | + 0 |
| 192 | + + if self.protocol == "" { 0 } else { 1 + sizeof_len((&self.protocol).len()) } |
| 193 | + + if self.url == "" { 0 } else { 1 + sizeof_len((&self.url).len()) } |
| 194 | + + if self.method == "" { 0 } else { 1 + sizeof_len((&self.method).len()) } |
| 195 | + } |
| 196 | + |
| 197 | + fn write_message<W: WriterBackend>(&self, w: &mut Writer<W>) -> Result<()> { |
| 198 | + if self.protocol != "" { w.write_with_tag(10, |w| w.write_string(&**&self.protocol))?; } |
| 199 | + if self.url != "" { w.write_with_tag(18, |w| w.write_string(&**&self.url))?; } |
| 200 | + if self.method != "" { w.write_with_tag(26, |w| w.write_string(&**&self.method))?; } |
| 201 | + Ok(()) |
| 202 | + } |
| 203 | +} |
| 204 | + |
0 commit comments