Skip to main content

IndexedMap

Struct IndexedMap 

Source
pub struct IndexedMap<'a, S>{ /* private fields */ }
Expand description

Strict coordinator for one source map and its active secondary indexes.

Implementations§

Source§

impl<S> IndexedMap<'_, S>

Source

pub fn export_current(&self) -> Result<IndexedSnapshotBundle, Error>

Export the exact catalog-selected current source and all active index trees.

Source

pub fn import_current( &self, bundle: &IndexedSnapshotBundle, expected_source: Option<&MapVersionId>, ) -> Result<IndexedVersion, Error>

Verify and atomically install a current indexed snapshot for this exact source ID.

expected_source == None means the destination source must be absent.

Source§

impl<'a, S> IndexedMap<'a, S>

Source

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

Stable source-map identifier.

Source

pub fn registry(&self) -> &SecondaryIndexRegistry

Borrow runtime definitions supplied when this handle was opened.

Source

pub fn source(&self) -> VersionedMap<'_, S>

Open the underlying source as a read-only raw map handle.

Source

pub fn get(&self, key: &[u8]) -> Result<Option<Vec<u8>>, Error>

Read one source key from the current durable head.

Source

pub fn health(&self) -> Result<IndexedMapHealth, Error>

Re-run bounded structural startup validation and return exact health state.

Source

pub fn metrics(&self) -> IndexedMapMetricsSnapshot

Snapshot cumulative logical work counters for this handle.

Source§

impl<S> IndexedMap<'_, S>

Source

pub fn ensure_index( &self, name: impl AsRef<[u8]>, ) -> Result<IndexBuildResult, Error>

Build a runtime definition against a pinned source snapshot and atomically activate it.

Source

pub fn verify_index( &self, name: impl AsRef<[u8]>, source_version: &MapVersionId, ) -> Result<IndexVerification, Error>

Rebuild and compare one exact retained source/index checkpoint without publishing roots.

Source

pub fn verify_all( &self, source_version: &MapVersionId, ) -> Result<Vec<IndexVerification>, Error>

Verify every generation currently selected by the catalog at one source version.

Source

pub fn repair_index( &self, name: impl AsRef<[u8]>, source_version: &MapVersionId, ) -> Result<IndexVerification, Error>

Rebuild and atomically correct one selected checkpoint when semantic drift exists.

Source

pub fn replace_index( &self, name: impl AsRef<[u8]>, new_definition: SecondaryIndex, ) -> Result<IndexBuildResult, Error>

Shadow-build and atomically replace one active definition generation.

Source

pub fn deactivate_index( &self, name: impl AsRef<[u8]>, ) -> Result<IndexedVersion, Error>

Remove one active selection while retaining its descriptors, checkpoints, and roots.

Source

pub fn apply(&self, mutations: Vec<Mutation>) -> Result<IndexedVersion, Error>

Apply source mutations while maintaining every active index atomically.

Source

pub fn apply_if( &self, expected: Option<&MapVersionId>, mutations: Vec<Mutation>, ) -> Result<IndexedMapUpdate, Error>

Conditionally apply source mutations when the expected source version is current.

Source

pub fn put( &self, key: impl Into<Vec<u8>>, value: impl Into<Vec<u8>>, ) -> Result<IndexedVersion, Error>

Insert or replace one source record and maintain all active indexes.

Source

pub fn delete(&self, key: impl Into<Vec<u8>>) -> Result<IndexedVersion, Error>

Delete one source record and maintain all active indexes.

Source

pub fn edit( &self, edit: impl FnOnce(&mut IndexedMapEditor), ) -> Result<IndexedVersion, Error>

Collect several source edits and publish one coordinated version.

Source§

impl<S> IndexedMap<'_, S>

Source

pub fn keep_last(&self, count: usize) -> Result<IndexedRetentionResult, Error>

Retain the newest source versions and their complete transitive index closure.

count == 0 still retains the current source. This removes named roots and catalog checkpoint records only; content-addressed nodes require a separate store-global GC plan/sweep.

Source§

impl<S> IndexedMap<'_, S>

Source

pub fn plan_indexed_gc(&self) -> Result<GcPlan, Error>

Plan node GC from every remaining named root in the shared store.

Source§

impl<'a, S> IndexedMap<'a, S>

Source

pub fn snapshot(&self) -> Result<IndexedSnapshot<'a, S>, Error>

Pin the current catalog first, then reopen every selected immutable root.

Source

pub fn snapshot_at( &self, source_version: &MapVersionId, ) -> Result<IndexedSnapshot<'a, S>, Error>

Reopen exact checkpoints for a retained source using current generations.

Source

pub fn snapshot_by_id( &self, id: &IndexedSnapshotId, ) -> Result<IndexedSnapshot<'a, S>, Error>

Reopen the exact retained catalog/source pair represented by id.

Auto Trait Implementations§

§

impl<'a, S> !Freeze for IndexedMap<'a, S>

§

impl<'a, S> !RefUnwindSafe for IndexedMap<'a, S>

§

impl<'a, S> !UnwindSafe for IndexedMap<'a, S>

§

impl<'a, S> Send for IndexedMap<'a, S>

§

impl<'a, S> Sync for IndexedMap<'a, S>

§

impl<'a, S> Unpin for IndexedMap<'a, S>

§

impl<'a, S> UnsafeUnpin for IndexedMap<'a, S>

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.