pub struct Session { /* private fields */ }Expand description
A persistent session for incremental sentence evaluation.
Maintains discourse state across multiple eval() calls, enabling
cross-sentence anaphora resolution and temporal ordering.
Implementations§
Source§impl Session
impl Session
Sourcepub fn with_format(format: OutputFormat) -> Self
pub fn with_format(format: OutputFormat) -> Self
Create a new session with a specific output format.
Sourcepub fn eval(&mut self, input: &str) -> Result<String, ParseError>
pub fn eval(&mut self, input: &str) -> Result<String, ParseError>
Evaluate a single sentence, updating the session state.
Returns the transpiled logic for just this sentence. Pronouns in this sentence can resolve to entities from previous sentences.
Sourcepub fn history(&self) -> String
pub fn history(&self) -> String
Get the full accumulated logic from all sentences.
Includes temporal ordering constraints (Precedes relations).
Sourcepub fn turn_count(&self) -> usize
pub fn turn_count(&self) -> usize
Get the number of sentences processed.
Sourcepub fn world_state(&self) -> &WorldState
pub fn world_state(&self) -> &WorldState
Get direct access to the world state (for advanced use).
Sourcepub fn world_state_mut(&mut self) -> &mut WorldState
pub fn world_state_mut(&mut self) -> &mut WorldState
Get mutable access to the world state (for advanced use).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Session
impl RefUnwindSafe for Session
impl Send for Session
impl Sync for Session
impl Unpin for Session
impl UnwindSafe for Session
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