MCPcopy Create free account
hub / github.com/3Hren/msgpack-rust / read_bin_data

Method read_bin_data

src/decode.rs:2270–2283  ·  view source on GitHub ↗
(&mut self, len: usize, mut visitor: V)

Source from the content-addressed store, hash-verified

2268 }
2269
2270 fn read_bin_data<V>(&mut self, len: usize, mut visitor: V) -> Result<V::Value>
2271 where V: serde::de::Visitor
2272 {
2273 self.buf.clear();
2274 self.buf.extend((0..len).map(|_| 0));
2275
2276 match read_full(&mut self.rd, &mut self.buf[..]) {
2277 Ok(n) if n == self.buf.len() => (),
2278 Ok(..) => return Err(Error::InvalidDataRead(ReadError::UnexpectedEOF)),
2279 Err(err) => return Err(Error::InvalidDataRead(ReadError::Io(err))),
2280 }
2281
2282 visitor.visit_bytes(&mut self.buf[..])
2283 }
2284}
2285
2286/// Unstable: docs; examples; incomplete

Callers 1

visitMethod · 0.80

Calls 2

read_fullFunction · 0.85
visit_bytesMethod · 0.80

Tested by

no test coverage detected