pub struct PrologModule {
pub name: Option<String>,
pub exported_predicates: Vec<String>,
pub items: Vec<PrologItem>,
pub description: Option<String>,
}Expand description
A complete Prolog source module (maps to a .pl file).
Fields§
§name: Option<String>Module name (used in :- module/2). None means no module declaration.
exported_predicates: Vec<String>Exported predicates as "Name/Arity" strings.
items: Vec<PrologItem>Top-level items in order.
description: Option<String>File-level comment/description.
Implementations§
Source§impl PrologModule
impl PrologModule
Sourcepub fn with_description(self, desc: impl Into<String>) -> Self
pub fn with_description(self, desc: impl Into<String>) -> Self
Set the file description.
Sourcepub fn add(&mut self, item: PrologItem)
pub fn add(&mut self, item: PrologItem)
Add an item.
Sourcepub fn directive(&mut self, d: PrologDirective)
pub fn directive(&mut self, d: PrologDirective)
Add a directive.
Sourcepub fn predicate(&mut self, p: PrologPredicate)
pub fn predicate(&mut self, p: PrologPredicate)
Add a predicate.
Trait Implementations§
Source§impl Clone for PrologModule
impl Clone for PrologModule
Source§fn clone(&self) -> PrologModule
fn clone(&self) -> PrologModule
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for PrologModule
impl RefUnwindSafe for PrologModule
impl Send for PrologModule
impl Sync for PrologModule
impl Unpin for PrologModule
impl UnsafeUnpin for PrologModule
impl UnwindSafe for PrologModule
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