pub struct SessionSemanticIndex { /* private fields */ }Expand description
In-memory, session-scoped SemanticIndex — pure (no fs), discarded at
/new. A flat Vec + brute-force cosine: simple, deterministic, and plenty
for a single repo’s chunks (no ANN/vector-db dependency in v1).
Trait Implementations§
Source§impl Default for SessionSemanticIndex
impl Default for SessionSemanticIndex
Source§fn default() -> SessionSemanticIndex
fn default() -> SessionSemanticIndex
Returns the “default value” for a type. Read more
Source§impl SemanticIndex for SessionSemanticIndex
impl SemanticIndex for SessionSemanticIndex
Source§fn index_chunk(&self, chunk: CodeChunk, embedding: Vec<f32>)
fn index_chunk(&self, chunk: CodeChunk, embedding: Vec<f32>)
Add an embedded chunk to the index.
Source§fn search(&self, query: &[f32], top_k: usize) -> Vec<(f32, CodeChunk)>
fn search(&self, query: &[f32], top_k: usize) -> Vec<(f32, CodeChunk)>
Top-
k chunks by cosine similarity to query, highest score first.Source§fn chunks_indexed(&self) -> u64
fn chunks_indexed(&self) -> u64
Chunks held (for
/context stats).Source§fn indexed_chars(&self) -> u64
fn indexed_chars(&self) -> u64
Total chars of indexed chunk text (for
/context stats).Auto Trait Implementations§
impl !Freeze for SessionSemanticIndex
impl RefUnwindSafe for SessionSemanticIndex
impl Send for SessionSemanticIndex
impl Sync for SessionSemanticIndex
impl Unpin for SessionSemanticIndex
impl UnsafeUnpin for SessionSemanticIndex
impl UnwindSafe for SessionSemanticIndex
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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 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>
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