pub struct GitStore {
pub workdir: PathBuf,
/* private fields */
}Fields§
§workdir: PathBufThe working directory (store root).
Implementations§
Source§impl GitStore
impl GitStore
pub fn init(store_root: &Path) -> Result<Self>
pub fn open(store_root: &Path) -> Result<Self>
pub fn detect_changes(&self) -> Result<Vec<FileChange>>
pub fn commit(&self, info: &CommitInfo) -> Result<Oid>
Sourcepub fn commits_since(&self, since: Oid) -> Result<Vec<LogEntry>>
pub fn commits_since(&self, since: Oid) -> Result<Vec<LogEntry>>
Commits reachable from HEAD but not including since, oldest first.
pub fn log(&self, limit: usize) -> Result<Vec<LogEntry>>
pub fn log_file(&self, path: &Path, limit: usize) -> Result<Vec<LogEntry>>
pub fn version_count(&self, path: &Path) -> Result<u32>
Sourcepub fn count_file_commits(&self, path: &Path) -> Result<usize>
pub fn count_file_commits(&self, path: &Path) -> Result<usize>
Count the number of commits that touched path without loading them into memory.
Sourcepub fn diff_file(
&self,
path: &Path,
v1: Option<u32>,
v2: Option<u32>,
) -> Result<String>
pub fn diff_file( &self, path: &Path, v1: Option<u32>, v2: Option<u32>, ) -> Result<String>
Diff a file between versions. None = working tree / latest commit.
pub fn diff_stats( &self, path: &Path, v1: Option<u32>, v2: Option<u32>, ) -> Result<DiffStats>
pub fn show_file_at_version(&self, path: &Path, version: u32) -> Result<String>
pub fn restore_file( &self, path: &Path, version: u32, doc_type: DocType, ) -> Result<Oid>
pub fn revert_file(&self, path: &Path) -> Result<()>
Sourcepub fn head_md_files(&self) -> Result<Vec<PathBuf>>
pub fn head_md_files(&self) -> Result<Vec<PathBuf>>
Return all .md file paths tracked in the git HEAD tree (relative to workdir).
pub fn save_rejected(&self, path: &Path, content: &str) -> Result<()>
Auto Trait Implementations§
impl !Sync for GitStore
impl Freeze for GitStore
impl RefUnwindSafe for GitStore
impl Send for GitStore
impl Unpin for GitStore
impl UnsafeUnpin for GitStore
impl UnwindSafe for GitStore
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