Struct git_commitgraph::graph::Graph [−][src]
A complete commit graph.
The data in the commit graph may come from a monolithic objects/info/commit-graph
file, or it
may come from one or more objects/info/commit-graphs/graph-*.graph
files. These files are
generated via git commit-graph write ...
commands.
Implementations
impl Graph
[src]
Access
pub fn commit_at(&self, pos: Position) -> Commit<'_>
[src]
pub fn commit_by_id(&self, id: impl AsRef<oid>) -> Option<Commit<'_>>
[src]
Returns the commit matching the given id
.
pub fn id_at(&self, pos: Position) -> &oid
[src]
pub fn iter_commits(&self) -> impl Iterator<Item = Commit<'_>>
[src]
Iterate over commits in unsorted order.
pub fn iter_ids(&self) -> impl Iterator<Item = &oid>
[src]
Iterate over commit IDs in unsorted order.
pub fn lookup(&self, id: impl AsRef<oid>) -> Option<Position>
[src]
Translate the given id
to its position in the file.
pub fn num_commits(&self) -> u32
[src]
Returns the number of commits stored in this file.
impl Graph
[src]
Instantiate a Graph
from various sources.
pub fn at(path: impl AsRef<Path>) -> Result<Self, Error>
[src]
Instantiate a commit graph from path
which may be a directory containing graph files or the graph file itself.
pub fn from_commit_graphs_dir(path: impl AsRef<Path>) -> Result<Self, Error>
[src]
Instantiate a commit graph from the directory containing all of its files.
pub fn from_file(path: impl AsRef<Path>) -> Result<Self, Error>
[src]
Instantiate a commit graph from a .git/objects/info/commit-graph
or
.git/objects/info/commit-graphs/graph-*.graph
file.
pub fn from_info_dir(info_dir: impl AsRef<Path>) -> Result<Self, Error>
[src]
Instantiate a commit graph from an .git/objects/info
directory.
pub fn new(files: Vec<File>) -> Result<Self, Error>
[src]
Create a new commit graph from a list of files
.
impl Graph
[src]
pub fn verify_integrity<E>(
&self,
processor: impl FnMut(&Commit<'_>) -> Result<(), E>
) -> Result<Outcome, Error<E>> where
E: Error + 'static,
[src]
&self,
processor: impl FnMut(&Commit<'_>) -> Result<(), E>
) -> Result<Outcome, Error<E>> where
E: Error + 'static,
Traverse all commits in the graph and call processor(&commit) -> Result<(), E>
on it while verifying checksums.
When processor
returns an error, the entire verification is stopped and the error returned.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Graph
impl Send for Graph
impl Sync for Graph
impl Unpin for Graph
impl UnwindSafe for Graph
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,