[][src]Struct git_commitgraph::file::File

pub struct File { /* fields omitted */ }

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 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) -> HashKind[src]

pub fn id_at(&self, pos: Position) -> Id<'_>[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 = Id<'_>>[src]

pub fn iter_commits(&self) -> impl Iterator<Item = Commit<'_>>[src]

pub fn iter_ids(&self) -> impl Iterator<Item = Id<'_>>[src]

pub fn lookup(&self, id: Id<'_>) -> Option<Position>[src]

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]

impl File[src]

pub fn at(path: impl AsRef<Path>) -> Result<File, Error>[src]

Trait Implementations

impl Debug for File[src]

impl<'_> TryFrom<&'_ Path> for File[src]

type Error = Error

The type returned in the event of a conversion error.

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.