axioval_rules/
lib.rs

1//! Built-in trusted source-neutral rule capabilities.
2#![forbid(unsafe_code)]
3
4use axioval_engine::{CapabilityRegistry, EngineError};
5
6mod free_floor_circle;
7mod free_floor_rectangle;
8mod property_comparison;
9mod property_rules;
10mod selection;
11
12pub use free_floor_circle::FreeFloorCircle;
13pub use free_floor_rectangle::FreeFloorRectangle;
14pub use property_comparison::PropertyComparison;
15pub use property_rules::{
16    BooleanPropertyEquals, PropertyExists, PropertyPredicate, PropertyRequired,
17};
18
19/// Registers all maintained built-in capabilities into a host registry.
20///
21/// # Errors
22///
23/// Returns an error if the registry already contains a built-in capability ID.
24pub fn register_builtins(registry: CapabilityRegistry) -> Result<CapabilityRegistry, EngineError> {
25    registry
26        .register(PropertyExists)
27        .and_then(|registry| registry.register(PropertyRequired))
28        .and_then(|registry| registry.register(BooleanPropertyEquals))
29        .and_then(|registry| registry.register(PropertyPredicate))
30        .and_then(|registry| registry.register(PropertyComparison))
31        .and_then(|registry| registry.register(FreeFloorCircle))
32        .and_then(|registry| registry.register(FreeFloorRectangle))
33}