pub struct Module {
pub name: String,
pub doc: Option<String>,
/* private fields */
}Expand description
A module in the knowledge base
Fields§
§name: StringModule name
doc: Option<String>Module documentation
Implementations§
Source§impl Module
impl Module
Sourcepub fn add_template(&mut self, template_name: impl Into<String>)
pub fn add_template(&mut self, template_name: impl Into<String>)
Add a template to this module
Sourcepub fn add_fact_type(&mut self, fact_type: impl Into<String>)
pub fn add_fact_type(&mut self, fact_type: impl Into<String>)
Add a fact type to this module
Sourcepub fn set_exports(&mut self, exports: ExportList)
pub fn set_exports(&mut self, exports: ExportList)
Set export specification
Sourcepub fn get_exports(&self) -> &ExportList
pub fn get_exports(&self) -> &ExportList
Get export specification
Sourcepub fn add_import(&mut self, import: ImportDecl)
pub fn add_import(&mut self, import: ImportDecl)
Add an import declaration
Sourcepub fn exports_rule(&self, rule_name: &str) -> bool
pub fn exports_rule(&self, rule_name: &str) -> bool
Check if this module exports a rule
Sourcepub fn exports_template(&self, template_name: &str) -> bool
pub fn exports_template(&self, template_name: &str) -> bool
Check if this module exports a template
Sourcepub fn get_templates(&self) -> &HashSet<String>
pub fn get_templates(&self) -> &HashSet<String>
Get all templates in this module
Sourcepub fn get_imports(&self) -> &[ImportDecl]
pub fn get_imports(&self) -> &[ImportDecl]
Get all imports
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Module
impl RefUnwindSafe for Module
impl Send for Module
impl Sync for Module
impl Unpin for Module
impl UnwindSafe for Module
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more