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>
impl<B: MemoryBacking> KernelVectorStore<B>
Sourcepub 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>
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.
Sourcepub const fn handle(&self) -> VectorStoreHandle
pub const fn handle(&self) -> VectorStoreHandle
Returns the store handle.
Sourcepub const fn dimensions(&self) -> u32
pub const fn dimensions(&self) -> u32
Returns the dimensions.
Sourcepub fn vector_get(
&self,
key: VectorKey,
capability: &Capability,
) -> Result<(Vec<f32>, CoherenceMeta)>
pub fn vector_get( &self, key: VectorKey, capability: &Capability, ) -> Result<(Vec<f32>, CoherenceMeta)>
Sourcepub fn vector_put_proved(
&mut self,
key: VectorKey,
data: &[f32],
proof: &ProofToken,
capability: &Capability,
current_time_ns: u64,
) -> Result<ProofAttestation>
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 keydata- The vector dataproof- The proof token authorizing the mutationcapability- Capability authorizing the writecurrent_time_ns- Current time for proof verification
§Returns
A proof attestation on success.
Sourcepub const fn proof_policy(&self) -> &ProofPolicy
pub const fn proof_policy(&self) -> &ProofPolicy
Returns the proof policy.
Sourcepub const fn coherence_tracker(&self) -> &CoherenceTracker
pub const fn coherence_tracker(&self) -> &CoherenceTracker
Returns the coherence tracker.
Sourcepub fn witness_entry_count(&self) -> usize
pub fn witness_entry_count(&self) -> usize
Returns witness log statistics.
Sourcepub fn witness_fill_ratio(&self) -> f32
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> 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
Mutably borrows from an owned value. Read more