pub struct Section {
pub kind: [u8; 8],
pub id: u64,
pub generation: u64,
pub extents: u32,
pub extent_page: u64,
pub extent_bytes: u32,
pub hash: u64,
pub flags: u32,
pub header_bytes: u32,
}Expand description
One entry in a table’s section table.
The payload is not here. This is the entry that says where the payload is, what it is, and whether it is still current, and it is all a reader needs to decide whether to read the payload at all.
Fields§
§kind: [u8; 8]Which kind of structure this is: one of KEY_MAP, FORWARD_LINK, ADJACENCY, or
something a later build wrote that this one carries through untouched.
id: u64Which structure of that kind. For a key map this identifies the column, for a forward link
the relationship. The format does not interpret it; rudb-graph assigns it.
generation: u64The table generation this section was built against.
A section whose stamp does not match the table’s is stale, and section 3.1 says stale means ignored rather than repaired. So this field is the whole of the maintenance story: there is no repair path in this crate because a mismatch here removes the section from consideration and the query runs the way it ran before the section existed.
extents: u32How many extents the payload is split into.
extent_page: u64Where the extent table starts.
extent_bytes: u32How many bytes the extent table takes.
hash: u64Checksum over the extent table, so a torn one is found before it is believed.
flags: u32Kind-specific flags. For a key map this carries which of the three forms was chosen, which is why a reader never has to guess a form.
header_bytes: u32Bytes of kind-specific header at the front of the first extent.
Implementations§
Source§impl Section
impl Section
Sourcepub fn known(&self) -> bool
pub fn known(&self) -> bool
Whether this build understands this section’s kind.
The five it knows are the three the graph document’s section 3.2 names and the two the statistics document’s sections 3.3 and 3.4 name. Everything else is a section a later build wrote, and the answer is to leave it alone: the entry is carried through a rewrite so that opening a file with an old build and closing it does not silently discard work, and the payload is never read.