[][src]Trait ieql::scan::scanner::Scanner

pub trait Scanner: Clone + Send {
    fn scan_batch(&self, documents: &CompiledDocumentBatch) -> OutputBatch;
fn scan_single(&self, document: &CompiledDocument) -> OutputBatch;
fn scan_concurrently(
        &self,
        batches: Receiver<DocumentReferenceBatch>,
        threads: u8
    ) -> Receiver<OutputBatch>; }

This trait specifies basic scanning functionality.

Required methods

fn scan_batch(&self, documents: &CompiledDocumentBatch) -> OutputBatch

Scan a batch of documents and return the output. This function is singlethreaded and often not very performant.

fn scan_single(&self, document: &CompiledDocument) -> OutputBatch

Scan a single document and return the output.

fn scan_concurrently(
    &self,
    batches: Receiver<DocumentReferenceBatch>,
    threads: u8
) -> Receiver<OutputBatch>

Launch a 'scan engine' and create an asynchronous and concurrent scanning system. In most cases, this is what you'll want to use.

To feed documents to the scanning engine, provide them through the mpsc::Receiver (via your mpsc::Sender). Outputs will be sent on the returned channel. The scan engine will automatically shut down when every transmitter paired with the receiver is dropped from memory.

Loading content...

Implementors

impl Scanner for CompiledQuery
[src]

impl Scanner for CompiledQueryGroup
[src]

Loading content...