pub struct Git2LogProvider { /* private fields */ }Expand description
Production adapter that reads commit history via git2.
Wraps git2::Repository in a Mutex to satisfy Send + Sync.
Args:
repo: Mutex-wrapped git2 repository handle.
Usage:
ⓘ
let provider = Git2LogProvider::open(Path::new("."))?;
let commits = provider.walk_commits(None, Some(100))?;Implementations§
Source§impl Git2LogProvider
impl Git2LogProvider
Sourcepub fn open(path: &Path) -> Result<Self, GitProviderError>
pub fn open(path: &Path) -> Result<Self, GitProviderError>
Open a git repository at the given path.
Args:
path: Filesystem path to the repository root.
Trait Implementations§
Source§impl GitLogProvider for Git2LogProvider
impl GitLogProvider for Git2LogProvider
Source§fn walk_commits(
&self,
range: Option<&str>,
limit: Option<usize>,
) -> Result<Vec<CommitRecord>, GitProviderError>
fn walk_commits( &self, range: Option<&str>, limit: Option<usize>, ) -> Result<Vec<CommitRecord>, GitProviderError>
Walk commit history, optionally constrained by a range spec and limit. Read more
Auto Trait Implementations§
impl !Freeze for Git2LogProvider
impl RefUnwindSafe for Git2LogProvider
impl Send for Git2LogProvider
impl Sync for Git2LogProvider
impl Unpin for Git2LogProvider
impl UnsafeUnpin for Git2LogProvider
impl UnwindSafe for Git2LogProvider
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more