pub struct GitSource { /* private fields */ }Expand description
Scans git history: traverses commits and extracts text blob contents.
§Examples
use keyhog_core::Source;
use keyhog_sources::GitSource;
use std::path::PathBuf;
let source = GitSource::new(PathBuf::from(".")).with_max_commits(10);
assert_eq!(source.name(), "git");Implementations§
Source§impl GitSource
impl GitSource
Sourcepub fn new(repo_path: PathBuf) -> Self
pub fn new(repo_path: PathBuf) -> Self
Create a source that traverses a git repository.
§Examples
use keyhog_core::Source;
use keyhog_sources::GitSource;
use std::path::PathBuf;
let source = GitSource::new(PathBuf::from("."));
assert_eq!(source.name(), "git");Sourcepub fn with_max_commits(self, n: usize) -> Self
pub fn with_max_commits(self, n: usize) -> Self
Limit how many commits are traversed from HEAD.
§Examples
use keyhog_core::Source;
use keyhog_sources::GitSource;
use std::path::PathBuf;
let source = GitSource::new(PathBuf::from(".")).with_max_commits(5);
assert_eq!(source.name(), "git");Trait Implementations§
Auto Trait Implementations§
impl Freeze for GitSource
impl RefUnwindSafe for GitSource
impl Send for GitSource
impl Sync for GitSource
impl Unpin for GitSource
impl UnsafeUnpin for GitSource
impl UnwindSafe for GitSource
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more