[][src]Trait ieql::common::compilation::CompilableTo

pub trait CompilableTo<T> {
    fn compile(&self) -> Result<T, Issue>;
}

The CompilableTo<T> trait specifies the compilation interface for each of IEQL's compilable internals, including Documents and Query groups, among others.

The fundamental idea of compilation in the Rust IEQL implementation is that every component of a scan has a certain amount of 'overhead'—that is, logic that must be repeated. For example, in Patterns, the RegEx must be composed by the RegEx library into something that can be used to scan text. This is a relatively expensive operation, and therefore it makes no sense to perform it multiple times.

In essence, compilation performs the repeated expensive logic for various IEQL components ahead of time to save time later.

Required methods

fn compile(&self) -> Result<T, Issue>

Returns a compiled version of self, without using self. Importantly, compiling a component will perform a deep clone on that component. Remember: compilation is expensive!

Loading content...

Implementors

impl CompilableTo<CompiledPattern> for Pattern[src]

fn compile(&self) -> Result<CompiledPattern, Issue>[src]

This function compiles the Pattern into a CompiledPattern by escaping the RegEx expression as necessary and then compiling it.

impl CompilableTo<CompiledDocument> for Document[src]

impl CompilableTo<CompiledDocumentBatch> for DocumentBatch[src]

impl CompilableTo<CompiledQuery> for Query[src]

fn compile(&self) -> Result<CompiledQuery, Issue>[src]

Compiles the Query into a CompiledQuery. Like all compilation operations, this is expensive.

impl CompilableTo<CompiledQueryGroup> for QueryGroup[src]

fn compile(&self) -> Result<CompiledQueryGroup, Issue>[src]

Compiles the QueryGroup into a CompiledQueryGroup. Like all compilation operations, this is expensive.

impl CompilableTo<CompiledScope> for Scope[src]

impl CompilableTo<CompiledTrigger> for Trigger[src]

Loading content...