Expand description
Module system for namespace isolation (CLIPS-inspired defmodule) Module System (CLIPS-inspired defmodule)
Provides namespace isolation and visibility control for large knowledge bases. Similar to CLIPS defmodule, Drools rule units, and package systems.
§Features
- Module Isolation: Separate namespaces for rules, templates, and facts
- Import/Export Control: Fine-grained visibility management
- Module Focus: Control execution flow across modules
- Pattern Matching: Export/import with wildcards (e.g., “sensor-*”)
§Example
use rust_rule_engine::engine::module::{ModuleManager, ExportList, ImportType};
let mut manager = ModuleManager::new();
// Create modules
manager.create_module("SENSORS").unwrap();
manager.create_module("CONTROL").unwrap();
// Configure exports
manager.export_all_from("SENSORS", ExportList::All).unwrap();
// Configure imports
manager.import_from("CONTROL", "SENSORS", ImportType::AllTemplates, "*").unwrap();
// Set focus
manager.set_focus("CONTROL").unwrap();Structs§
- Export
Item - Single export item
- Import
Decl - Import declaration
- Module
- A module in the knowledge base
- Module
Info - Information about a single module
- Module
Manager - Module manager for organizing knowledge bases
- Module
Stats - Module statistics
Enums§
- Export
List - Export list specification
- Import
Type - Import type specification
- Item
Type - Type of item that can be exported/imported