pub struct Git2BlueprintStore { /* private fields */ }Expand description
Git2-backed BlueprintStore — one bare repo per BlueprintId under
<root>/<id>/.git/, delegating the mechanical blob/commit work to a
shared Git2BlobStore.
Implementations§
Source§impl Git2BlueprintStore
impl Git2BlueprintStore
Sourcepub fn open_or_init(root: impl AsRef<Path>) -> Result<Self, BlueprintStoreError>
pub fn open_or_init(root: impl AsRef<Path>) -> Result<Self, BlueprintStoreError>
Open (or create) the store rooted at root. Per-id repositories
are created lazily on first write/read.
Trait Implementations§
Source§impl BlueprintStore for Git2BlueprintStore
impl BlueprintStore for Git2BlueprintStore
Source§fn name(&self) -> &str
fn name(&self) -> &str
Backend identifier, for logging / diagnostics (e.g.
"git2",
"in-memory").Source§fn read_head<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 BlueprintId,
) -> Pin<Box<dyn Future<Output = Result<Traced<Blueprint>, BlueprintStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn read_head<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 BlueprintId,
) -> Pin<Box<dyn Future<Output = Result<Traced<Blueprint>, BlueprintStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Read the current head — the latest commit for this
BlueprintId.Source§fn write_new<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
id: &'life1 BlueprintId,
new_bp: &'life2 Blueprint,
parents: &'life3 [BlueprintVersion],
metadata: CommitMetadata,
) -> Pin<Box<dyn Future<Output = Result<BlueprintVersion, BlueprintStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn write_new<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
id: &'life1 BlueprintId,
new_bp: &'life2 Blueprint,
parents: &'life3 [BlueprintVersion],
metadata: CommitMetadata,
) -> Pin<Box<dyn Future<Output = Result<BlueprintVersion, BlueprintStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Append a new Blueprint. Computes the
ContentHash and returns the
resulting BlueprintVersion.Source§fn read_version<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 BlueprintId,
version: BlueprintVersion,
) -> Pin<Box<dyn Future<Output = Result<Traced<Blueprint>, BlueprintStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn read_version<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 BlueprintId,
version: BlueprintVersion,
) -> Pin<Box<dyn Future<Output = Result<Traced<Blueprint>, BlueprintStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Look up a past version — used for audit or debug.
Source§fn history<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 BlueprintId,
limit: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<BlueprintVersion>, BlueprintStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn history<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 BlueprintId,
limit: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<BlueprintVersion>, BlueprintStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
List history newest-to-oldest, up to
limit; head included.Source§fn read_commit_rationale<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 BlueprintId,
version: BlueprintVersion,
) -> Pin<Box<dyn Future<Output = Result<Option<String>, BlueprintStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn read_commit_rationale<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 BlueprintId,
version: BlueprintVersion,
) -> Pin<Box<dyn Future<Output = Result<Option<String>, BlueprintStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Return the rationale attached to a commit (its
CommitMetadata.rationale, a one-line changelog). Backends that
cannot recover it return Ok(None); the trait’s default
implementation returns None.Source§fn list_ids<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<BlueprintId>, BlueprintStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_ids<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<BlueprintId>, BlueprintStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
List every
BlueprintId (relevant when the Layout::Multi axis
is in use).Source§fn archive_id<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 BlueprintId,
) -> Pin<Box<dyn Future<Output = Result<(), BlueprintStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn archive_id<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 BlueprintId,
) -> Pin<Box<dyn Future<Output = Result<(), BlueprintStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Archive a
BlueprintId — logical soft-delete via an archive
marker commit. After archive, read_head returns
BlueprintStoreError::Archived, list_ids filters the id
out by default, and downstream resolvers (e.g. swarm_run(id))
hard-reject with the same error. Read moreSource§fn unarchive_id<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 BlueprintId,
) -> Pin<Box<dyn Future<Output = Result<(), BlueprintStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn unarchive_id<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 BlueprintId,
) -> Pin<Box<dyn Future<Output = Result<(), BlueprintStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Reverse of
archive_id — append an unarchive marker commit to
the main head and re-expose the id.Source§fn is_archived<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 BlueprintId,
) -> Pin<Box<dyn Future<Output = Result<bool, BlueprintStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn is_archived<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 BlueprintId,
) -> Pin<Box<dyn Future<Output = Result<bool, BlueprintStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Return
true if the id is currently archived. Default returns
Ok(false) for backends that never archive.Auto Trait Implementations§
impl !Freeze for Git2BlueprintStore
impl RefUnwindSafe for Git2BlueprintStore
impl Send for Git2BlueprintStore
impl Sync for Git2BlueprintStore
impl Unpin for Git2BlueprintStore
impl UnsafeUnpin for Git2BlueprintStore
impl UnwindSafe for Git2BlueprintStore
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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