Skip to main content

ObjectFront

Struct ObjectFront 

Source
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

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn block_in_place<F>(&self, fut: F) -> F::Output
where F: Future + Send, F::Output: Send,

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.

Source

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

Source

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.

Source

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.

Source

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.

Trait Implementations§

Source§

impl Clone for ObjectFront

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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