pub struct GitHistorySource { /* private fields */ }Expand description
Scans git history commit-by-commit using patch output and extracts added lines.
§Examples
use keyhog_core::Source;
use keyhog_sources::GitHistorySource;
use std::path::PathBuf;
let source = GitHistorySource::new(PathBuf::from(".")).with_max_commits(25);
assert_eq!(source.name(), "git-history");Implementations§
Source§impl GitHistorySource
impl GitHistorySource
Sourcepub fn new(repo_path: PathBuf) -> Self
pub fn new(repo_path: PathBuf) -> Self
Create a source that scans commit history patches for added lines.
§Examples
use keyhog_core::Source;
use keyhog_sources::GitHistorySource;
use std::path::PathBuf;
let source = GitHistorySource::new(PathBuf::from("."));
assert_eq!(source.name(), "git-history");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::GitHistorySource;
use std::path::PathBuf;
let source = GitHistorySource::new(PathBuf::from(".")).with_max_commits(2);
assert_eq!(source.name(), "git-history");Trait Implementations§
Source§impl Source for GitHistorySource
impl Source for GitHistorySource
Auto Trait Implementations§
impl Freeze for GitHistorySource
impl RefUnwindSafe for GitHistorySource
impl Send for GitHistorySource
impl Sync for GitHistorySource
impl Unpin for GitHistorySource
impl UnsafeUnpin for GitHistorySource
impl UnwindSafe for GitHistorySource
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