MCPcopy Create free account
hub / github.com/f0rr0/oliphaunt / parse

Method parse

src/protocol/serializer.rs:163–184  ·  view source on GitHub ↗
(name: Option<&str>, text: &str, types: &[i32])

Source from the content-addressed store, hash-verified

161 }
162
163 pub fn parse(name: Option<&str>, text: &str, types: &[i32]) -> Vec<u8> {
164 if let Some(name) = name
165 && name.len() > 63
166 {
167 warn!(
168 "Postgres only supports 63 characters for query names. You supplied {len}",
169 len = name.len()
170 );
171 }
172
173 let mut writer = BufferWriter::default();
174 writer
175 .add_cstring(name.unwrap_or(""))
176 .add_cstring(text)
177 .add_int16(types.len() as i16);
178
179 for oid in types {
180 writer.add_int32(*oid);
181 }
182
183 writer.flush(Some(CODE_PARSE))
184 }
185
186 pub fn bind(config: &BindConfig) -> Vec<u8> {
187 let mut writer = BufferWriter::default();

Callers

nothing calls this directly

Calls 5

lenMethod · 0.80
add_int16Method · 0.45
add_cstringMethod · 0.45
add_int32Method · 0.45
flushMethod · 0.45

Tested by

no test coverage detected