git_commitgraph/graph/mod.rs
1//! Operations on a complete commit graph.
2mod access;
3mod init;
4pub mod verify;
5
6use std::fmt;
7
8use crate::file::File;
9
10/// A complete commit graph.
11///
12/// The data in the commit graph may come from a monolithic `objects/info/commit-graph` file, or it
13/// may come from one or more `objects/info/commit-graphs/graph-*.graph` files. These files are
14/// generated via `git commit-graph write ...` commands.
15pub struct Graph {
16 files: Vec<File>,
17}
18
19/// A generalized position for use in [`Graph`].
20#[derive(Clone, Copy, Debug, Eq, Ord, PartialEq, PartialOrd, Hash)]
21pub struct Position(pub u32);
22
23impl fmt::Display for Position {
24 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
25 self.0.fmt(f)
26 }
27}