Struct liboxen::core::index::commit_writer::CommitWriter
source · pub struct CommitWriter {
pub commits_db: DBWithThreadMode<MultiThreaded>,
/* private fields */
}Fields§
§commits_db: DBWithThreadMode<MultiThreaded>Implementations§
source§impl CommitWriter
impl CommitWriter
pub fn commit_db_dir(path: &Path) -> PathBuf
pub fn new(repository: &LocalRepository) -> Result<CommitWriter, OxenError>
pub fn commit( &self, status: &StagedData, message: &str, ) -> Result<Commit, OxenError>
pub fn commit_from_new( &self, new_commit: &NewCommit, status: &StagedData, origin_path: &Path, ) -> Result<Commit, OxenError>
sourcepub fn commit_workspace(
&self,
workspace: &Workspace,
branch: &Branch,
new_commit: &NewCommit,
status: &StagedData,
) -> Result<Commit, OxenError>
pub fn commit_workspace( &self, workspace: &Workspace, branch: &Branch, new_commit: &NewCommit, status: &StagedData, ) -> Result<Commit, OxenError>
Commit a workspace to a branch with a new commit
pub fn stage_files_for_commit( &self, workspace: &Workspace, entries: &[CommitEntry], ) -> Result<StagedData, OxenError>
pub fn commit_with_parent_ids_on_branch( &self, status: &StagedData, parent_ids: Vec<String>, message: &str, branch: Branch, cfg: UserConfig, ) -> Result<Commit, OxenError>
pub fn commit_with_parent_ids( &self, status: &StagedData, parent_ids: Vec<String>, message: &str, ) -> Result<Commit, OxenError>
pub fn add_commit_from_empty_status( &self, commit: &Commit, ) -> Result<(), OxenError>
pub fn add_commit_from_status( &self, commit: &Commit, status: &StagedData, working_dir: &Path, ) -> Result<Commit, OxenError>
pub fn add_commit_to_db(&self, commit: &Commit) -> Result<(), OxenError>
pub async fn set_working_repo_to_commit( &self, commit: &Commit, ) -> Result<(), OxenError>
pub fn get_commit_by_id( &self, commit_id: &str, ) -> Result<Option<Commit>, OxenError>
Auto Trait Implementations§
impl !Freeze for CommitWriter
impl RefUnwindSafe for CommitWriter
impl Send for CommitWriter
impl Sync for CommitWriter
impl Unpin for CommitWriter
impl UnwindSafe for CommitWriter
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