Skip to main content

KernelVectorStore

Struct KernelVectorStore 

Source
pub struct KernelVectorStore<B: MemoryBacking> { /* private fields */ }
Expand description

Kernel-resident vector store.

Implements the vector_get and vector_put_proved syscall interfaces.

Implementations§

Source§

impl<B: MemoryBacking> KernelVectorStore<B>

Source

pub fn new( data_backing: B, hnsw_backing: B, witness_backing: B, data_handle: RegionHandle, hnsw_handle: RegionHandle, witness_handle: RegionHandle, dimensions: u32, capacity: u32, hnsw_config: HnswConfig, coherence_config: CoherenceConfig, proof_policy: ProofPolicy, store_id: u32, ) -> Result<Self>

Creates a new kernel vector store.

Source

pub const fn handle(&self) -> VectorStoreHandle

Returns the store handle.

Source

pub fn len(&self) -> usize

Returns the number of vectors stored.

Source

pub fn is_empty(&self) -> bool

Returns true if the store is empty.

Source

pub const fn capacity(&self) -> u32

Returns the capacity.

Source

pub const fn dimensions(&self) -> u32

Returns the dimensions.

Source

pub fn vector_get( &self, key: VectorKey, capability: &Capability, ) -> Result<(Vec<f32>, CoherenceMeta)>

Implements the vector_get syscall.

Returns the vector data and its coherence metadata. Requires READ right on the capability.

§Arguments
  • key - The vector key
  • capability - Capability authorizing the read
§Returns

The vector data and coherence metadata.

Source

pub fn vector_put_proved( &mut self, key: VectorKey, data: &[f32], proof: &ProofToken, capability: &Capability, current_time_ns: u64, ) -> Result<ProofAttestation>

Implements the vector_put_proved syscall.

Writes a vector with proof verification. Requires PROVE right on the capability.

§Arguments
  • key - The vector key
  • data - The vector data
  • proof - The proof token authorizing the mutation
  • capability - Capability authorizing the write
  • current_time_ns - Current time for proof verification
§Returns

A proof attestation on success.

Source

pub const fn proof_policy(&self) -> &ProofPolicy

Returns the proof policy.

Source

pub const fn coherence_tracker(&self) -> &CoherenceTracker

Returns the coherence tracker.

Source

pub fn witness_entry_count(&self) -> usize

Returns witness log statistics.

Source

pub fn witness_fill_ratio(&self) -> f32

Returns the witness log fill ratio.

Auto Trait Implementations§

§

impl<B> Freeze for KernelVectorStore<B>
where B: Freeze,

§

impl<B> RefUnwindSafe for KernelVectorStore<B>
where B: RefUnwindSafe,

§

impl<B> !Send for KernelVectorStore<B>

§

impl<B> !Sync for KernelVectorStore<B>

§

impl<B> Unpin for KernelVectorStore<B>
where B: Unpin,

§

impl<B> UnsafeUnpin for KernelVectorStore<B>
where B: UnsafeUnpin,

§

impl<B> UnwindSafe for KernelVectorStore<B>
where B: UnwindSafe,

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