pub struct VersionControl<S: BlockStore> { /* private fields */ }Expand description
Version Control System for managing commits, branches, and tags
Implementations§
Source§impl<S: BlockStore> VersionControl<S>
impl<S: BlockStore> VersionControl<S>
Sourcepub async fn commit(
&self,
root: Cid,
message: String,
author: Author,
metadata: HashMap<String, String>,
) -> Result<Cid>
pub async fn commit( &self, root: Cid, message: String, author: Author, metadata: HashMap<String, String>, ) -> Result<Cid>
Create a new commit
§Arguments
root- CID of the root block (e.g., model weights)message- Commit messageauthor- Author informationmetadata- Optional metadata
Sourcepub async fn checkout(&self, commit_cid: &Cid) -> Result<Cid>
pub async fn checkout(&self, commit_cid: &Cid) -> Result<Cid>
Checkout to a specific commit
Returns the root CID of the commit (e.g., model weights to load)
Sourcepub async fn checkout_ref(&self, ref_name: &str) -> Result<Cid>
pub async fn checkout_ref(&self, ref_name: &str) -> Result<Cid>
Checkout to a branch or tag
Sourcepub async fn create_branch(&self, branch_name: &str) -> Result<()>
pub async fn create_branch(&self, branch_name: &str) -> Result<()>
Create a new branch at the current HEAD
Sourcepub async fn create_tag(&self, tag_name: &str) -> Result<()>
pub async fn create_tag(&self, tag_name: &str) -> Result<()>
Create a new tag at the current HEAD
Sourcepub fn current_branch(&self) -> String
pub fn current_branch(&self) -> String
Get the current branch name
Sourcepub async fn log(&self, commit_cid: &Cid, limit: usize) -> Result<Vec<Commit>>
pub async fn log(&self, commit_cid: &Cid, limit: usize) -> Result<Vec<Commit>>
Get commit history (walk the DAG backwards)
Sourcepub async fn find_common_ancestor(
&self,
commit1: &Cid,
commit2: &Cid,
) -> Result<Option<Cid>>
pub async fn find_common_ancestor( &self, commit1: &Cid, commit2: &Cid, ) -> Result<Option<Cid>>
Find common ancestor between two commits
Sourcepub async fn is_ancestor(
&self,
ancestor: &Cid,
descendant: &Cid,
) -> Result<bool>
pub async fn is_ancestor( &self, ancestor: &Cid, descendant: &Cid, ) -> Result<bool>
Check if commit1 is an ancestor of commit2 (i.e., fast-forward is possible)
Sourcepub async fn merge(
&self,
branch_cid: &Cid,
message: String,
author: Author,
strategy: MergeStrategy,
) -> Result<MergeResult>
pub async fn merge( &self, branch_cid: &Cid, message: String, author: Author, strategy: MergeStrategy, ) -> Result<MergeResult>
Merge a branch into the current HEAD
§Arguments
branch_cid- The commit CID to merge into current HEADmessage- Merge commit messageauthor- Author of the merge commitstrategy- Merge strategy to use
Sourcepub async fn merge_branch(
&self,
branch_name: &str,
message: String,
author: Author,
strategy: MergeStrategy,
) -> Result<MergeResult>
pub async fn merge_branch( &self, branch_name: &str, message: String, author: Author, strategy: MergeStrategy, ) -> Result<MergeResult>
Merge a named branch into current HEAD
Auto Trait Implementations§
impl<S> !Freeze for VersionControl<S>
impl<S> !RefUnwindSafe for VersionControl<S>
impl<S> Send for VersionControl<S>
impl<S> Sync for VersionControl<S>
impl<S> Unpin for VersionControl<S>
impl<S> UnwindSafe for VersionControl<S>where
S: RefUnwindSafe,
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