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 using a callback that creates a sub domain hierarchy.

Errors
  • failed to compile scripts.

build a cheap rhai engine with vsl’s api.

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.

Build vsl global modules.

Errors
  • Failed to build modules.

Build vsl static modules.

Errors
  • Failed to build modules.

compile vsl’s api into a module.

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

Check if the rule engine have configuration available for the domain of the given address.

NOTE: Check recursively all parents of the given domain, return true if any parent domain is handled by the configuration.

Find the delegate directive that matches the given socket.

Trait Implementations§

Formats the value using the given formatter. Read more

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