pub struct SubstrateAssembly { /* private fields */ }Expand description
The complete wired backend — the single composition entry’s product
(substrate.md §public API’s members): the five backend-trait
implementations as Arc<dyn ...> plus the machinery’s handles.
The runtime legs are the embedder’s to drive:
self.chain().run(worker_id, stop, on_event)
runs the supervision (the sweep schedule, the scheduler leg, the
supervised wake runner — the provider invalidation’s delivery, the
reconcile tick, the worker claim loop) under one caller-owned stop
token. Nothing spawns at construction.
The public API = authorized-surface rule: the op and session layers reach the backend only through the core’s traits (the returned trait objects); the receive-pack composition — the pending-pin registry and the wrapped refs impl — is internal to the trait impls (substrate.md §public API’s internal-members rule).
Implementations§
Source§impl SubstrateAssembly
impl SubstrateAssembly
Sourcepub async fn mem(
store: Arc<dyn Store>,
blobs: Arc<BlobStore>,
options: AssemblyOptions,
) -> Result<Self, OpenError>
pub async fn mem( store: Arc<dyn Store>, blobs: Arc<BlobStore>, options: AssemblyOptions, ) -> Result<Self, OpenError>
The mem assembly — the completeness shape (the batteries- included degenerate case: single-process, the in-memory registry adapter and refs table, no feature gates, ADR-024 §6).
store is the alkstore engine the reactive halves and the
maintenance chain ride; blobs is the object pool the
git-object family lives under — the substrate engine handles,
supplied (the mem entry opens nothing; “no engine dependency”
realized honestly). See the module doc for the failure set.
Sourcepub async fn sqlite(
path: impl AsRef<Path>,
options: AssemblyOptions,
) -> Result<Self, OpenError>
pub async fn sqlite( path: impl AsRef<Path>, options: AssemblyOptions, ) -> Result<Self, OpenError>
The sqlite assembly — the default single-host shape (substrate.md §assembly shapes row one): one co-tenant file.
path is the sqlite file the registry/ref tables, the
alkstore-sqlite engine, and the alkblobs kv engine share (the
co-tenancy composition posture; the migrations run at the twin
assembly’s construction, loud — a half-migrated store refuses
service).
Source§impl SubstrateAssembly
impl SubstrateAssembly
Sourcepub fn registry(&self) -> &Arc<dyn GitRegistry> ⓘ
pub fn registry(&self) -> &Arc<dyn GitRegistry> ⓘ
The registry read side (GitRegistry — the resolve hot
path, served through the cached provider).
Sourcepub fn registry_store(&self) -> &Arc<dyn GitRegistryStore> ⓘ
pub fn registry_store(&self) -> &Arc<dyn GitRegistryStore> ⓘ
The registry store side (GitRegistryStore — the record
mutations, announcing post-commit and writing through).
Sourcepub fn refs(&self) -> &Arc<dyn GitRefs> ⓘ
pub fn refs(&self) -> &Arc<dyn GitRefs> ⓘ
The refs side (GitRefs) — the receive flow’s committed-ref
side: stale-prune → CAS → drain-only-after-commit, then the
per-push marker + announce legs.
Sourcepub fn packgen(&self) -> &Arc<dyn GitPackGen> ⓘ
pub fn packgen(&self) -> &Arc<dyn GitPackGen> ⓘ
The pack generation side (GitPackGen, assembled in the
configured serving shape).
Sourcepub fn ingest(&self) -> &Arc<dyn GitPackIngest> ⓘ
pub fn ingest(&self) -> &Arc<dyn GitPackIngest> ⓘ
The pack ingest side (GitPackIngest — the receive path’s
prepare leg, custody via the shared pending-pin registry).
Sourcepub fn front(&self) -> &ObjectFront
pub fn front(&self) -> &ObjectFront
The object front (constructed once; per-session
SessionFind views).
Sourcepub fn reactor(&self) -> &Arc<Reactor> ⓘ
pub fn reactor(&self) -> &Arc<Reactor> ⓘ
The reactor (the announce machinery; the stream consumer and the reconcile sweep’s home for replication-style embedders).
Sourcepub fn chain(&self) -> &MaintenanceChain
pub fn chain(&self) -> &MaintenanceChain
The maintenance chain (the embedder drives
MaintenanceChain::run).
Sourcepub fn applied_watermark(&self) -> &Arc<AppliedWatermark> ⓘ
pub fn applied_watermark(&self) -> &Arc<AppliedWatermark> ⓘ
The composition’s applied watermark — the same handle the
reconcile tick advances; hand it to
Reactor::run_stream_consumer alongside.
Sourcepub fn provider(&self) -> &Arc<CachedRegistryProvider> ⓘ
pub fn provider(&self) -> &Arc<CachedRegistryProvider> ⓘ
The cached read provider (the hot read’s home — replication and observation consumers).
Sourcepub fn blobs(&self) -> &Arc<BlobStore> ⓘ
pub fn blobs(&self) -> &Arc<BlobStore> ⓘ
The object pool (the git-object family’s home; the LFS surface’s base).
Sourcepub fn liveness_registration(&self) -> &Registration
pub fn liveness_registration(&self) -> &Registration
The liveness source’s registration token (the composition holds it for the store’s lifetime; deregister/re-register is the embedder’s ADR-012 §6.4 correction flow).
Sourcepub fn lfs_registration(&self) -> &Registration
pub fn lfs_registration(&self) -> &Registration
The LFS media source’s registration token (lfs — the second
registration leg, registered beside the ref-table closure’s at
the composition entry; the fail-safe default ADR-022 §6). The
same lifetime posture: the composition holds it, the
deregister/re-register correction flow is the embedder’s.
Sourcepub fn lfs_rows(&self) -> &Arc<dyn LfsRows> ⓘ
pub fn lfs_rows(&self) -> &Arc<dyn LfsRows> ⓘ
The LFS pointer-lifecycle row store (the lfs feature’s
row-op surface): the batch adapter’s assertion surface (rows
asserted at check/upload time — lfs.md §3) and the LFS
liveness source’s read (all rows / per-repo rows — the
re-protection contract’s refcount data; the wave-9 liveness
task consumes this accessor). The surface is the wrapped shape
on every source (crate::lfs::VersionedLfsRows — every
assert bumps Self::lfs_registration’s counter): on the
engine assemblies the wrap is the twins’ own (they carry it at
construction; the entry composes it unchanged, no double wrap).
Source§impl SubstrateAssembly
The refs writes’ shared counter — bumped by every CAS call through
the refs side; the liveness source’s arbitration epoch signal
(observation data).
impl SubstrateAssembly
The refs writes’ shared counter — bumped by every CAS call through the refs side; the liveness source’s arbitration epoch signal (observation data).
Sourcepub fn refs_version(&self) -> u64
pub fn refs_version(&self) -> u64
The counter’s current value.