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>
Sourcepub async fn get_commit(&self, commit_id: Uuid) -> Result<Commit>
pub async fn get_commit(&self, commit_id: Uuid) -> Result<Commit>
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>>
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
§Errors
Returns an error if the commit does not exist or the database insert fails.
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
§Errors
Returns an error if the snapshot is not found or the database query fails.
Auto Trait Implementations§
impl Freeze for VersionControl
impl !RefUnwindSafe for VersionControl
impl Send for VersionControl
impl Sync for VersionControl
impl Unpin for VersionControl
impl UnsafeUnpin 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