Struct git_commitgraph::file::File [−][src]
A single commit-graph file.
All operations on a File
are local to that graph file. Since a commit graph can span multiple
files, all interesting graph operations belong on Graph
.
Implementations
impl File
[src]
Access
pub fn base_graph_count(&self) -> u8
[src]
The number of base graphs that this file depends on.
pub fn commit_at(&self, pos: Position) -> Commit<'_>
[src]
Returns the commit data for the commit located at the given lexigraphical position.
pos
must range from 0 to self.num_commits().
Panics
Panics if pos
is out of bounds.
pub fn hash_kind(&self) -> Kind
[src]
The kind of hash used in this File.
Note that it is always conforming to the hash used in the owning repository.
pub fn id_at(&self, pos: Position) -> &oid
[src]
Returns 20 bytes sha1 at the given index in our list of (sorted) sha1 hashes. The position ranges from 0 to self.num_commits()
pub fn iter_base_graph_ids(&self) -> impl Iterator<Item = &oid>
[src]
Return an iterator over all object hashes stored in the base graph.
pub fn iter_commits(&self) -> impl Iterator<Item = Commit<'_>>
[src]
return an iterator over all commits in this file.
pub fn iter_ids(&self) -> impl Iterator<Item = &oid>
[src]
Return an iterator over all object hashes stored in this file.
pub fn lookup(&self, id: impl AsRef<oid>) -> Option<Position>
[src]
Translate the given object hash to its position within this file, if present.
pub fn num_commits(&self) -> u32
[src]
Returns the number of commits in this graph file.
The maximum valid file::Position
that can be used with this file is one less than
num_commits()
.
pub fn path(&self) -> &Path
[src]
Returns the path to this file.
impl File
[src]
pub fn at(path: impl AsRef<Path>) -> Result<File, Error>
[src]
Try to parse the commit graph file at path
.
impl File
[src]
Verification
pub fn checksum(&self) -> &oid
[src]
Returns the trailing checksum over the entire content of this file.
pub fn traverse<'a, E, Processor>(
&'a self,
processor: Processor
) -> Result<Outcome, Error<E>> where
E: Error + 'static,
Processor: FnMut(&Commit<'a>) -> Result<(), E>,
[src]
&'a self,
processor: Processor
) -> Result<Outcome, Error<E>> where
E: Error + 'static,
Processor: FnMut(&Commit<'a>) -> Result<(), E>,
Traverse all commits stored in this file and call processor(commit) -> Result<(), Error>
on it.
If the processor
fails, the iteration will be stopped and the entire call results in the respective error.
pub fn verify_checksum(&self) -> Result<ObjectId, (ObjectId, ObjectId)>
[src]
Assure the checksum
matches the actual checksum over all content of this file, excluding the trailing
checksum itself.
Return the actual checksum on success or (actual checksum, expected checksum)
if there is a mismatch.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for File
impl Send for File
impl Sync for File
impl Unpin for File
impl UnwindSafe for File
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>,