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

Function collect_fields

src/protocol/messages.rs:457–471  ·  view source on GitHub ↗
(
    reader: &mut crate::protocol::buffer_reader::BufferReader<'_>,
)

Source from the content-addressed store, hash-verified

455}
456
457pub fn collect_fields(
458 reader: &mut crate::protocol::buffer_reader::BufferReader<'_>,
459) -> Result<std::collections::HashMap<String, String>> {
460 use std::collections::HashMap;
461 let mut map = HashMap::new();
462 loop {
463 let field_type = reader.string(1)?;
464 if field_type == "\0" {
465 break;
466 }
467 let value = reader.cstring()?;
468 map.insert(field_type, value);
469 }
470 Ok(map)
471}

Callers 2

parse_error_messageMethod · 0.85
parse_notice_messageMethod · 0.85

Calls 3

stringMethod · 0.80
cstringMethod · 0.80
insertMethod · 0.80

Tested by

no test coverage detected