pub struct AsyncProximityHead<S: AsyncStore> { /* private fields */ }Expand description
Durable named-head orchestration for async proximity maps.
The head owns validation reuse, a long-lived authenticated search runtime, expected-head CAS, and bounded conflict retry. Immutable map bytes remain readable through the underlying AsyncStore without this manager.
Implementations§
Source§impl<S> AsyncProximityHead<S>where
S: AsyncStore + AsyncManifestStore + Clone,
<S as AsyncStore>::Error: Send + Sync,
<S as AsyncManifestStore>::Error: Send + Sync,
impl<S> AsyncProximityHead<S>where
S: AsyncStore + AsyncManifestStore + Clone,
<S as AsyncStore>::Error: Send + Sync,
<S as AsyncManifestStore>::Error: Send + Sync,
pub fn new(store: S, name: impl Into<Vec<u8>>) -> Self
pub fn with_runtime( store: S, name: impl Into<Vec<u8>>, runtime: Arc<SearchRuntime>, ) -> Self
pub fn with_limits(self, limits: ContentGraphLimits) -> Self
pub fn with_max_conflict_retries(self, retries: usize) -> Self
pub fn runtime(&self) -> &Arc<SearchRuntime> ⓘ
pub fn name(&self) -> &[u8] ⓘ
Sourcepub async fn open(&self) -> Result<Option<AsyncProximitySnapshot<S>>, Error>
pub async fn open(&self) -> Result<Option<AsyncProximitySnapshot<S>>, Error>
Open the current head, reusing a validation receipt only when the named manifest CID is unchanged on this manager and store instance.
Sourcepub async fn build_if_absent(
&self,
config: ProximityConfig,
records: impl IntoIterator<Item = ProximityRecord>,
options: AsyncProximityBuildOptions,
created_at_millis: u64,
metadata: BTreeMap<Vec<u8>, Vec<u8>>,
) -> Result<AsyncProximityHeadCommit<S, ProximityBuildStats>, Error>
pub async fn build_if_absent( &self, config: ProximityConfig, records: impl IntoIterator<Item = ProximityRecord>, options: AsyncProximityBuildOptions, created_at_millis: u64, metadata: BTreeMap<Vec<u8>, Vec<u8>>, ) -> Result<AsyncProximityHeadCommit<S, ProximityBuildStats>, Error>
Build a canonical map and install it only when the named head is absent.
Sourcepub async fn publish_descriptor_if_absent(
&self,
descriptor: Cid,
logical_version: u64,
created_at_millis: u64,
metadata: BTreeMap<Vec<u8>, Vec<u8>>,
) -> Result<AsyncProximityHeadCommit<S, ()>, Error>
pub async fn publish_descriptor_if_absent( &self, descriptor: Cid, logical_version: u64, created_at_millis: u64, metadata: BTreeMap<Vec<u8>, Vec<u8>>, ) -> Result<AsyncProximityHeadCommit<S, ()>, Error>
Validate and install an already-published proximity descriptor when the named head is absent. This is useful when construction and durable head publication are separate application stages.
Sourcepub async fn mutate_with_retry(
&self,
mutations: impl IntoIterator<Item = ProximityMutation>,
created_at_millis: u64,
metadata: BTreeMap<Vec<u8>, Vec<u8>>,
) -> Result<AsyncProximityHeadCommit<S, ProximityMutationStats>, Error>
pub async fn mutate_with_retry( &self, mutations: impl IntoIterator<Item = ProximityMutation>, created_at_millis: u64, metadata: BTreeMap<Vec<u8>, Vec<u8>>, ) -> Result<AsyncProximityHeadCommit<S, ProximityMutationStats>, Error>
Apply a mutation batch against the current validated head and atomically publish the resulting descriptor. Conflicts reopen fresh state and retry up to the configured bound.
Auto Trait Implementations§
impl<S> !Freeze for AsyncProximityHead<S>
impl<S> RefUnwindSafe for AsyncProximityHead<S>
impl<S> Send for AsyncProximityHead<S>
impl<S> Sync for AsyncProximityHead<S>
impl<S> Unpin for AsyncProximityHead<S>
impl<S> UnsafeUnpin for AsyncProximityHead<S>
impl<S> UnwindSafe for AsyncProximityHead<S>
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
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> ⓘ
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> ⓘ
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