Skip to main content

IndexEvent

Enum IndexEvent 

Source
pub enum IndexEvent {
    ScanStart {
        total_sources: usize,
    },
    SourceStarted {
        source_id: String,
    },
    FileParsed {
        source_id: String,
        path: String,
        chunks: usize,
    },
    EmbeddingBatch {
        count: usize,
    },
    WritingStore,
    SourceComplete {
        source_id: String,
        chunks: usize,
    },
    Complete {
        files: usize,
        chunks: usize,
        files_skipped: usize,
        files_removed: usize,
    },
    Error {
        message: String,
    },
}
Expand description

Events emitted while building or rebuilding an index.

Consume these events via Indexer::index_file_stream, Indexer::index_directory_stream, or the Engine::index_stream family of methods.

Variants§

§

ScanStart

Indexing started; number of sources/files to process.

Fields

§total_sources: usize

Total number of sources or files that will be processed.

§

SourceStarted

A source is about to be indexed.

Fields

§source_id: String

Identifier of the source (e.g. collection name).

§

FileParsed

A file was parsed into chunks.

Fields

§source_id: String

Identifier of the source this file belongs to.

§path: String

Path of the parsed file.

§chunks: usize

Number of chunks produced from the file.

§

EmbeddingBatch

A batch of chunks is being embedded.

Fields

§count: usize

Number of chunks in this batch.

§

WritingStore

The index store is being written.

§

SourceComplete

A source finished indexing.

Fields

§source_id: String

Identifier of the source.

§chunks: usize

Number of chunks indexed for this source.

§

Complete

Indexing is complete.

Fields

§files: usize

Total number of files indexed.

§chunks: usize

Total number of chunks indexed.

§files_skipped: usize

Total number of files skipped because they were unchanged.

§files_removed: usize

Total number of files removed because they no longer exist.

§

Error

An error occurred.

Fields

§message: String

Human-readable error message.

Trait Implementations§

Source§

impl Clone for IndexEvent

Source§

fn clone(&self) -> IndexEvent

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for IndexEvent

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for IndexEvent

Source§

fn eq(&self, other: &IndexEvent) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for IndexEvent

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.