| 158 | /// A script backend routes every message with query context and the query itself. |
| 159 | #[async_trait] |
| 160 | pub trait ScriptBackend: Validatable<Error = ScriptError> { |
| 161 | /// Process the query. |
| 162 | async fn route( |
| 163 | &self, |
| 164 | query: Message<Bytes>, |
| 165 | ctx: Option<QueryContext>, |
| 166 | ) -> Result<Message<Bytes>>; |
| 167 | } |
| 168 | |
| 169 | /// A script builder is a type that builds itself into a script backend. |
| 170 | #[async_trait(?Send)] |