pub struct ObjectFront { /* private fields */ }Expand description
The one-time object front over the substrate’s alkblobs store: the handle-sharing shape’s constructed-once half (backend.md §crate and feature model). The object pool is global, not per-repo-namespaced — repo scoping is the refs rows’ and liveness sources’ business.
Construct within the running runtime (the assembly does): the
constructor captures Handle::current() for the sync/async bridge.
Implementations§
Source§impl ObjectFront
impl ObjectFront
Sourcepub fn new(store: Arc<Store>) -> Self
pub fn new(store: Arc<Store>) -> Self
The front over the substrate store. The store handle is shared, not owned: pools are process-wide, the front is a view over one.
Sourcepub fn session(&self) -> SessionFind
pub fn session(&self) -> SessionFind
A per-session view: carries its own lookup-miss slot, sharing the front’s store and runtime handles. Mint one per protocol session.
Sourcepub fn store(&self) -> &Arc<Store> ⓘ
pub fn store(&self) -> &Arc<Store> ⓘ
The shared store handle — the substrate composition’s object
pool. Batch puts (put_in_batch), range serving (read_range),
and the GC wiring ride this handle; the front’s legs are the
loose-object seam over it.
Sourcepub fn block_on<F: Future>(&self, fut: F) -> F::Output
pub fn block_on<F: Future>(&self, fut: F) -> F::Output
The one sync Find / async store bridge, blocking-context half:
the call pack pipelines own (Handle::block_on against the
front’s captured runtime handle — poco-findings §trait posture).
Call it only from a blocking context (tokio::task::spawn_blocking
pipeline tasks); in async contexts it panics (the POC-O panic
shape — regression-tested) and ObjectFront::block_in_place is
the bridge instead.
Sourcepub fn block_in_place<F>(&self, fut: F) -> F::Output
pub fn block_in_place<F>(&self, fut: F) -> F::Output
The bridge’s async-context half (the POC-O liveness-source posture): parks the worker and serves the store call through the blocking pool, making the bridge legal on an async worker. Requires a multi-thread runtime.
Sourcepub async fn put(
&self,
kind: Kind,
content: &[u8],
) -> Result<(Key, Pin), StorageError>
pub async fn put( &self, kind: Kind, content: &[u8], ) -> Result<(Key, Pin), StorageError>
The write leg: put one loose object under the family, riding the
known-length derivation seam
(put_as(Algorithm::GitObjectSha1, len, stream)) with the
preimage length declared. Verification-on-put is the oid
re-derivation: the store derives the digest from the stored
bytes, and the front rejects a put whose returned key does not
re-derive to the object’s oid — corruption cannot enter.
Returns the family key and the put’s pin guard (the wave-8 pin bridge holds these across the ingest → CAS span; dropping the guard releases the entry to the sweep window).
Sourcepub async fn get(
&self,
oid: &oid,
) -> Result<Option<(Kind, Vec<u8>)>, StorageError>
pub async fn get( &self, oid: &oid, ) -> Result<Option<(Kind, Vec<u8>)>, StorageError>
The read leg: the loose object behind oid, its kind decoded
from the header the odb layer owns. Verification-on-get is the
oid re-derivation run over the delivered bytes (the store’s kv
tier verifies at open; the front re-verifies the full value so
large-tier deliveries — not re-derived there — fail the read
too): a corrupted entry is StorageError::Invalid.
Sourcepub async fn kind(&self, oid: &oid) -> Result<Option<Kind>, StorageError>
pub async fn kind(&self, oid: &oid) -> Result<Option<Kind>, StorageError>
The object’s kind behind oid, read from the loose header the
odb layer owns — a bounded prefix read (gix_object’s
loose_header parses
a scan-to-NUL header; the body is never touched). None is a
definitive miss. The kv tier’s own get-time verification still
fails a corrupted entry (mapped Invalid); the large tier’s
header parse is shape-level — body corruption fails the serving
reads that consume the body instead.
Sourcepub async fn stat(&self, oid: &oid) -> Result<Option<EntryMeta>, StorageError>
pub async fn stat(&self, oid: &oid) -> Result<Option<EntryMeta>, StorageError>
The stat leg: the family entry’s metadata — len is the
preimage length (the stored loose form, git’s header included),
the family semantic (alkblobs ADR-018 §Decision 3), never the
content length. None is a definitive miss.