Check whether a byte slice looks like a provenance graph file. Fast check — only inspects the 4-byte magic prefix.
(data: &[u8])
| 345 | /// |
| 346 | /// Fast check — only inspects the 4-byte magic prefix. |
| 347 | pub fn is_provenance_graph(data: &[u8]) -> bool { |
| 348 | data.len() >= MAGIC.len() && &data[..4] == MAGIC |
| 349 | } |
| 350 | |
| 351 | /// Number of nodes in the graph. |
| 352 | pub fn node_count(&self) -> usize { |