MCPcopy Create free account
hub / github.com/cosdata/cosdata / read

Method read

org/src/viewer.rs:51–59  ·  view source on GitHub ↗
(reader: &mut impl Read)

Source from the content-addressed store, hash-verified

49
50impl IndexPtr {
51 fn read(reader: &mut impl Read) -> io::Result<Self> {
52 let mut buffer = [0u8; 8];
53 reader.read_exact(&mut buffer)?;
54
55 Ok(IndexPtr {
56 offset: u32::from_le_bytes(buffer[0..4].try_into().unwrap()),
57 file_id: u32::from_le_bytes(buffer[4..8].try_into().unwrap()),
58 })
59 }
60
61 fn is_absent(&self) -> bool {
62 self.offset == u32::MAX || self.file_id == u32::MAX

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected