Struct holmes::engine::Engine [] [src]

pub struct Engine<FE: Error + Send + 'static, FDB: FactDB<Error = FE>> { /* fields omitted */ }

The Engine type contains the context necessary to run a Holmes program

Methods

impl<FE, FDB> Engine<FE, FDB> where
    FE: Error + Send + 'static,
    FDB: FactDB<Error = FE>, 
[src]

Create a fresh engine by handing it a fact database to use

Seach the type registry for a named type If present, it returns Some(type), otherwise None

Register a new type This type must be a named type (e.g. type.name() should return Some)

Register a new predicate This defines the type signature of a predicate and persists it

  • Predicates must have at least one argument
  • Predicates must have a unique name
  • While using the pg backend, their name must be lowercase ascii or '_'

Retrieves a named predicate from the database. This is primarily of use for retrieving metadata about a predicate for display.

Adds a new fact to the database If the fact is already present, a new copy will not be added.

  • The relevant predicate must already be registered
  • The fact must be correctly typed

Returns success in the appropriate type. This helper function is to support the EDSL, and it is not anticipated to be useful normally.

Given a query (similar to the rhs of a rule in Datalog), provide the set of satisfying answers in the database.

Render a predicate as an html table

Register a new rule with the database

Register a new function with the database, to be called from within a rule

Do not attempt to register a function name multiple times.

Creates a quiescence future to be run on the event loop provided when the engine was created. The future will only gaurantee quiescence upon completion so long as no new rules have been added.