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

Method close

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

Source from the content-addressed store, hash-verified

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()));
273 text.push(target.target_type);
274 if let Some(name) = &target.name {
275 text.push_str(name);
276 }
277 let mut writer = BufferWriter::default();
278 writer.add_cstring(&text);
279 writer.flush(Some(CODE_CLOSE))
280 }
281
282 pub fn flush() -> Vec<u8> {
283 code_only_buffer(CODE_FLUSH)

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