pub struct Engine { /* private fields */ }
Expand description
A Prolog engine.
Prolog engines can be active or inactive. When activated, an
EngineActivation
is returned, which when dropped will set the
engine back into an inactive state.
Implementations§
source§impl Engine
impl Engine
sourcepub fn new() -> Engine
pub fn new() -> Engine
Create a new prolog engine.
If SWI-Prolog has not been initialized yet, it’ll be done here.
sourcepub fn with_state(state: &'static [u8]) -> Engine
pub fn with_state(state: &'static [u8]) -> Engine
Create a new prolog engine with a saved state. SWI-Prolog must not have been initialized already to do so.
sourcepub fn some_engine_active() -> bool
pub fn some_engine_active() -> bool
Returns true if some engine is currently active on this thread.
sourcepub fn is_active(&self) -> bool
pub fn is_active(&self) -> bool
Returns true if this engine is the engine currently active on this thread.
sourcepub fn activate(&self) -> EngineActivation<'_>
pub fn activate(&self) -> EngineActivation<'_>
Activate this engine.
This will panic if an engine is already active on this
thread. Otherwise, it’ll return an EngineActivation
whose
lifetime is bound to this engine.
Trait Implementations§
impl Send for Engine
impl Sync for Engine
Auto Trait Implementations§
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