ops_rs/trigger/predicates/
mod.rs1pub mod inline;
2pub use inline::InlinePredicateOp;
3use serde_json::json;
4
5use crate::{DryContext, Op, OpMetadata, OpResult, WetContext};
6
7use async_trait::async_trait;
8
9#[derive(Clone, Debug)]
11pub struct TrivialPredicate {}
12
13impl Default for TrivialPredicate {
14 fn default() -> Self {
15 Self {}
16 }
17}
18
19#[async_trait]
20impl Op<bool> for TrivialPredicate {
21 async fn perform(&self, _dry: &mut DryContext, _wet: &mut WetContext) -> OpResult<bool> {
22 Ok(true)
23 }
24
25 fn metadata(&self) -> OpMetadata {
26 OpMetadata::builder("TrivialPredicate")
27 .description("A predicate that always returns true")
28 .input_schema(json!({
29 "type": "object",
30 "properties": {},
31 "description": "No specific input required"
32 }))
33 .output_schema(json!({
34 "type": "boolean",
35 "description": "Always true"
36 }))
37 .build()
38 }
39}