pub struct GitStore { /* private fields */ }Implementations§
Source§impl GitStore
impl GitStore
Sourcepub fn open(root: impl Into<PathBuf>) -> Result<Self>
pub fn open(root: impl Into<PathBuf>) -> Result<Self>
Open an existing git repo at root, or initialize one if absent.
Sourcepub async fn pull(&self, remote: &str, branch: &str) -> Result<PullReport>
pub async fn pull(&self, remote: &str, branch: &str) -> Result<PullReport>
Pull branch from remote (typically “origin”). A fast-forward advances
the branch; a divergence is reconciled by a content-aware 3-way merge
(gonzalo merge() per record, ADR 0017), with unresolved records kept
local and reported in the PullReport.
Trait Implementations§
Source§impl Store for GitStore
impl Store for GitStore
Source§fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 RecordKey,
) -> Pin<Box<dyn Future<Output = Result<Option<Record>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 RecordKey,
) -> Pin<Box<dyn Future<Output = Result<Option<Record>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Fetch a record by key, or
None if absent.Source§fn put<'life0, 'async_trait>(
&'life0 self,
record: Record,
expected: Option<Revision>,
) -> Pin<Box<dyn Future<Output = Result<PutResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn put<'life0, 'async_trait>(
&'life0 self,
record: Record,
expected: Option<Revision>,
) -> Pin<Box<dyn Future<Output = Result<PutResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Conditionally write
record. expected is the revision the caller
believes is current (None means “expect no existing record”).
If the store’s current revision differs, returns PutResult::Conflict.Source§fn list<'life0, 'life1, 'async_trait>(
&'life0 self,
prefix: &'life1 KeyPrefix,
) -> Pin<Box<dyn Future<Output = Result<Vec<RecordKey>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn list<'life0, 'life1, 'async_trait>(
&'life0 self,
prefix: &'life1 KeyPrefix,
) -> Pin<Box<dyn Future<Output = Result<Vec<RecordKey>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
List keys matching
prefix.Source§fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 RecordKey,
expected: Option<Revision>,
) -> Pin<Box<dyn Future<Output = Result<DeleteResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 RecordKey,
expected: Option<Revision>,
) -> Pin<Box<dyn Future<Output = Result<DeleteResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Conditionally delete the record at
key. expected is the revision the
caller believes is current: None deletes unconditionally (idempotent
no-op if already absent); Some(rev) deletes only if the current revision
matches, returning DeleteResult::Conflict if a concurrent write moved it
first. Deleting an already-absent key is a no-op Deleted. Read moreAuto Trait Implementations§
impl Freeze for GitStore
impl RefUnwindSafe for GitStore
impl Send for GitStore
impl Sync for GitStore
impl Unpin for GitStore
impl UnsafeUnpin for GitStore
impl UnwindSafe for GitStore
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