pub struct VersionControl { /* private fields */ }Expand description
Version control system for workspaces
Implementations§
Source§impl VersionControl
impl VersionControl
Sourcepub async fn create_commit(
&self,
workspace_id: Uuid,
author_id: Uuid,
message: String,
parent_id: Option<Uuid>,
version: i64,
snapshot: Value,
changes: Value,
) -> Result<Commit>
pub async fn create_commit( &self, workspace_id: Uuid, author_id: Uuid, message: String, parent_id: Option<Uuid>, version: i64, snapshot: Value, changes: Value, ) -> Result<Commit>
Create a commit
Sourcepub async fn get_commit(&self, commit_id: Uuid) -> Result<Commit>
pub async fn get_commit(&self, commit_id: Uuid) -> Result<Commit>
Get a commit by ID
Sourcepub async fn get_history(
&self,
workspace_id: Uuid,
limit: Option<i32>,
) -> Result<Vec<Commit>>
pub async fn get_history( &self, workspace_id: Uuid, limit: Option<i32>, ) -> Result<Vec<Commit>>
Get commit history for a workspace
Sourcepub async fn get_latest_commit(
&self,
workspace_id: Uuid,
) -> Result<Option<Commit>>
pub async fn get_latest_commit( &self, workspace_id: Uuid, ) -> Result<Option<Commit>>
Get the latest commit for a workspace
Sourcepub async fn create_snapshot(
&self,
workspace_id: Uuid,
name: String,
description: Option<String>,
commit_id: Uuid,
created_by: Uuid,
) -> Result<Snapshot>
pub async fn create_snapshot( &self, workspace_id: Uuid, name: String, description: Option<String>, commit_id: Uuid, created_by: Uuid, ) -> Result<Snapshot>
Create a named snapshot
Sourcepub async fn get_snapshot(
&self,
workspace_id: Uuid,
name: &str,
) -> Result<Snapshot>
pub async fn get_snapshot( &self, workspace_id: Uuid, name: &str, ) -> Result<Snapshot>
Get a snapshot by name
Sourcepub async fn list_snapshots(&self, workspace_id: Uuid) -> Result<Vec<Snapshot>>
pub async fn list_snapshots(&self, workspace_id: Uuid) -> Result<Vec<Snapshot>>
List all snapshots for a workspace
Auto Trait Implementations§
impl Freeze for VersionControl
impl !RefUnwindSafe for VersionControl
impl Send for VersionControl
impl Sync for VersionControl
impl Unpin for VersionControl
impl !UnwindSafe for VersionControl
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