pub struct RuleEngine { /* private fields */ }
Expand description

a sharable rhai engine. contains an ast representation of the user’s parsed .vsl script files, and modules / packages to create a cheap rhai runtime.

Implementations

creates a new instance of the rule engine, reading all files in the script_path parameter. if script_path is None, a warning is emitted and a deny-all script is loaded.

Errors
  • failed to register script_path as a valid module folder.
  • failed to compile or load any script located at script_path.

create a rule engine instance from a script.

Errors
  • failed to compile the script.

runs all rules from a stage using the current transaction state.

the server_address parameter is used to distinguish logs from each other, printing the address & port associated with this run session, not the current context. (because the context could have been pulled from the filesystem when receiving delegation results)

Panics

Instantiate a RuleState and run it for the only state provided

Return

A tuple with the mail context, body, result status, and skip status.

create a rhai engine to compile all scripts with vsl’s configuration.

compile vsl’s api into a module.

Errors
  • Failed to compile the API.
  • Failed to create a module from the API.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more