pub struct VersionControlRepository { /* private fields */ }Expand description
Version control repository
Implementations§
Source§impl VersionControlRepository
impl VersionControlRepository
Sourcepub fn new(
orchestration_id: String,
storage_path: String,
) -> Result<Self, String>
pub fn new( orchestration_id: String, storage_path: String, ) -> Result<Self, String>
Create a new repository
Sourcepub fn load(
orchestration_id: String,
storage_path: String,
) -> Result<Self, String>
pub fn load( orchestration_id: String, storage_path: String, ) -> Result<Self, String>
Load repository from disk
Sourcepub fn commit(
&mut self,
author: String,
email: String,
message: String,
content: &Value,
) -> Result<Commit, String>
pub fn commit( &mut self, author: String, email: String, message: String, content: &Value, ) -> Result<Commit, String>
Create a commit
Sourcepub fn create_branch(
&mut self,
name: String,
from_commit: Option<String>,
) -> Result<Branch, String>
pub fn create_branch( &mut self, name: String, from_commit: Option<String>, ) -> Result<Branch, String>
Create a new branch
Sourcepub fn diff(
&self,
from_commit: String,
to_commit: String,
) -> Result<Diff, String>
pub fn diff( &self, from_commit: String, to_commit: String, ) -> Result<Diff, String>
Get diff between two commits
Sourcepub fn history(&self, max_count: Option<usize>) -> Result<Vec<Commit>, String>
pub fn history(&self, max_count: Option<usize>) -> Result<Vec<Commit>, String>
Get commit history
Sourcepub fn list_branches(&self) -> Vec<Branch>
pub fn list_branches(&self) -> Vec<Branch>
Get all branches
Sourcepub fn current_branch(&self) -> &str
pub fn current_branch(&self) -> &str
Get current branch name
Trait Implementations§
Source§impl Debug for VersionControlRepository
impl Debug for VersionControlRepository
Source§impl<'de> Deserialize<'de> for VersionControlRepository
impl<'de> Deserialize<'de> for VersionControlRepository
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for VersionControlRepository
impl RefUnwindSafe for VersionControlRepository
impl Send for VersionControlRepository
impl Sync for VersionControlRepository
impl Unpin for VersionControlRepository
impl UnwindSafe for VersionControlRepository
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> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request