Skip to main content

SubstrateAssembly

Struct SubstrateAssembly 

Source
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

Source

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.

Source

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

Source

pub fn registry(&self) -> &Arc<dyn GitRegistry> ⓘ

The registry read side (GitRegistry — the resolve hot path, served through the cached provider).

Source

pub fn registry_store(&self) -> &Arc<dyn GitRegistryStore> ⓘ

The registry store side (GitRegistryStore — the record mutations, announcing post-commit and writing through).

Source

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.

Source

pub fn packgen(&self) -> &Arc<dyn GitPackGen> ⓘ

The pack generation side (GitPackGen, assembled in the configured serving shape).

Source

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).

Source

pub fn front(&self) -> &ObjectFront

The object front (constructed once; per-session SessionFind views).

Source

pub fn reactor(&self) -> &Arc<Reactor> ⓘ

The reactor (the announce machinery; the stream consumer and the reconcile sweep’s home for replication-style embedders).

Source

pub fn chain(&self) -> &MaintenanceChain

The maintenance chain (the embedder drives MaintenanceChain::run).

Source

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.

Source

pub fn provider(&self) -> &Arc<CachedRegistryProvider> ⓘ

The cached read provider (the hot read’s home — replication and observation consumers).

Source

pub fn blobs(&self) -> &Arc<BlobStore> ⓘ

The object pool (the git-object family’s home; the LFS surface’s base).

Source

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).

Source

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.

Source

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).

Source

pub fn refs_version(&self) -> u64

The counter’s current value.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more