Skip to main content

AsyncProximityHead

Struct AsyncProximityHead 

Source
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>

Source

pub fn new(store: S, name: impl Into<Vec<u8>>) -> Self

Source

pub fn with_runtime( store: S, name: impl Into<Vec<u8>>, runtime: Arc<SearchRuntime>, ) -> Self

Source

pub fn with_limits(self, limits: ContentGraphLimits) -> Self

Source

pub fn with_max_conflict_retries(self, retries: usize) -> Self

Source

pub fn runtime(&self) -> &Arc<SearchRuntime>

Source

pub fn name(&self) -> &[u8]

Source

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.

Source

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.

Source

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.

Source

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§

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<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
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> 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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.