camel-language-api
Language trait API for rust-camel (Expression, Predicate)
Overview
camel-language-api defines the core traits for the rust-camel Languages subsystem, inspired by Apache Camel's Language SPI.
Traits
| Trait | Description |
|---|---|
Language |
Factory that produces Expression and Predicate instances from scripts |
Expression |
Evaluates a script against an Exchange, returning a serde_json::Value |
Predicate |
Evaluates a script against an Exchange, returning a bool |
Error Handling
All operations return Result<_, LanguageError> with variants:
ParseError— invalid expression syntaxEvalError— runtime evaluation failureUnknownVariable— referenced variable not foundNotFound— language not registered
Usage
use ;
use Exchange;
License
Apache-2.0