#![cfg_attr(
all(doc, feature = "document-features"),
doc = ::document_features::document_features!()
)]
#![cfg_attr(all(doc, feature = "document-features"), feature(doc_cfg))]
#![deny(missing_docs, rust_2018_idioms, unsafe_code)]
use std::path::Path;
pub struct File {
base_graph_count: u8,
base_graphs_list_offset: Option<usize>,
commit_data_offset: usize,
data: memmap2::Mmap,
extra_edges_list_range: Option<std::ops::Range<usize>>,
fan: [u32; file::FAN_LEN],
oid_lookup_offset: usize,
path: std::path::PathBuf,
hash_len: usize,
object_hash: gix_hash::Kind,
}
pub struct Graph {
files: Vec<File>,
}
pub fn at(path: impl AsRef<Path>) -> Result<Graph, init::Error> {
Graph::at(path.as_ref())
}
mod access;
pub mod file;
pub mod init;
pub mod verify;
pub const GENERATION_NUMBER_INFINITY: u32 = 0xffff_ffff;
pub const GENERATION_NUMBER_MAX: u32 = 0x3fff_ffff;
pub const MAX_COMMITS: u32 = (1 << 30) + (1 << 29) + (1 << 28) - 1;
#[derive(Clone, Copy, Debug, Eq, Ord, PartialEq, PartialOrd, Hash)]
pub struct Position(pub u32);
impl std::fmt::Display for Position {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
self.0.fmt(f)
}
}