Expand description
Prolog results.
Functions in swipl-rs that interact with SWI-Prolog generally
return a PrologResult. This allows you to use them with the ?
syntax in situations where you need to call multiple such
functions, and each failure or exception is a reason to exit
early.
This module also provides some transformations on prolog results.
Structs
- Unit type for errors which can only be an exception.
Enums
- A prolog error.
Functions
- Transforms a
PrologResult<()>
into a BoolPrologResult, allowing more easy use from an if block. - Transforms a PrologResult into an OptPrologResult, allowing more easy use from an if block.
- Return a failure.
- Turn a boolean into a prolog result.
Type Aliases
- Result type for expressing failure as a boolean instead of an Err.
- Result type for operations that cannot fail, but can throw an exception.
- result type for expressing failure as an Option type instead of an Err.
- The main result type that most interface functions return.