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

Method describe

src/protocol/serializer.rs:256–269  ·  view source on GitHub ↗
(target: &PortalTarget)

Source from the content-addressed store, hash-verified

254 }
255
256 pub fn describe(target: &PortalTarget) -> Vec<u8> {
257 let mut writer = BufferWriter::default();
258 if let Some(name) = &target.name {
259 let mut text = String::with_capacity(1 + name.len());
260 text.push(target.target_type);
261 text.push_str(name);
262 writer.add_cstring(&text);
263 } else {
264 let mut value = String::with_capacity(2);
265 value.push(target.target_type);
266 writer.add_cstring(&value);
267 }
268 writer.flush(Some(CODE_DESCRIBE))
269 }
270
271 pub fn close(target: &PortalTarget) -> Vec<u8> {
272 let mut text = String::with_capacity(target.name.as_ref().map_or(1, |s| 1 + s.len()));

Callers

nothing calls this directly

Calls 4

lenMethod · 0.80
pushMethod · 0.80
add_cstringMethod · 0.45
flushMethod · 0.45

Tested by

no test coverage detected