Skip to main content

Session

Struct Session 

Source
pub struct Session { /* private fields */ }
Expand description

A running local one-worker Core check and its stop-scoped inspection capability.

use dive_api::{CheckRequest, debug::{Session, Event}};
let mut session = Session::launch(CheckRequest { file:"Spec.tla".into(), ..Default::default() }, false)?;
session.wait_event(std::time::Duration::from_secs(10))?;
session.configuration_done()?;
while let Some(event) = session.wait_event(std::time::Duration::from_secs(10))? {
    if matches!(event, Event::Completed(_)) { break; }
}
let report = session.finish()?;

Implementations§

Source§

impl Session

Source

pub fn launch( request: CheckRequest, stop_on_entry: bool, ) -> Result<Self, DebugError>

Starts loading/compiling with existing checking APIs. Search waits for configuration. The report retains the requested worker width; observed search uses one actual worker.

§Errors

An unsupported managed-session combination or failed thread creation.

Source

pub fn wait_event(&self, timeout: Duration) -> Result<Option<Event>, DebugError>

Waits at most the given duration for a real producer event.

§Errors

A wait above one minute is rejected.

Source

pub fn set_breakpoints( &self, path: &str, lines: &[u32], ) -> Result<Vec<Breakpoint>, DebugError>

Installs exact-line source breakpoints using only already-loaded sources.

§Errors

Unknown source, invalid/capacity line request or unavailable compilation.

Source

pub fn break_on_entry(&self, enabled: bool) -> Result<(), DebugError>

Configures an entry stop before the pending producer search starts.

§Errors

Search has started or the session is unavailable.

Source

pub fn configuration_done(&self) -> Result<(), DebugError>

Starts actual search after breakpoint/configuration requests.

§Errors

Compilation is unavailable or the session has terminated.

Source

pub fn exception_breakpoints(&self, enabled: bool) -> Result<(), DebugError>

Selects actual evaluation-error/property-failure stops.

§Errors

The compiled session is unavailable or complete.

Source

pub fn pause(&self) -> Result<(), DebugError>

Requests a stop at the next mapped producer instruction.

§Errors

Search is not active.

Source

pub fn continue_check(&self) -> Result<(), DebugError>

Continues actual execution and expires all stop handles.

§Errors

The producer is not stopped.

Source

pub fn step_in(&self) -> Result<(), DebugError>

Stops at the next mapped instruction, including nested evaluation.

§Errors

The producer is not stopped.

Source

pub fn next(&self) -> Result<(), DebugError>

Steps over nested instruction activations.

§Errors

The producer is not stopped.

Source

pub fn step_out(&self) -> Result<(), DebugError>

Runs until an enclosing actual activation is reached.

§Errors

The producer is not stopped.

Source

pub fn stack(&self) -> Result<Vec<Value>, DebugError>

Returns the current actual source/activation stack.

§Errors

The producer is not stopped.

Source

pub fn scopes(&self, frame: u64) -> Result<Vec<Value>, DebugError>

Returns state, successor and local scope handles for a current frame.

§Errors

The frame handle is stale/unknown or the producer is running.

Source

pub fn variables(&self, reference: u64) -> Result<Vec<Value>, DebugError>

Reads a current scope’s captured values without evaluating source.

§Errors

The scope handle is stale/unknown or the producer is running.

Source

pub fn evaluate( &self, frame: u64, expression: &str, ) -> Result<Value, DebugError>

Evaluates bounded integer/boolean arithmetic in a fresh compiler/machine over captured scalars. No producer recipe or source helper is executed.

§Errors

A stale frame, unavailable operand, unsupported syntax or work bound.

Source

pub fn source(&self, reference: usize) -> Result<String, DebugError>

Returns only a source already loaded by this session, without opening a path.

§Errors

The loaded-source reference is invalid or unavailable.

Source

pub fn terminate(&self)

Requests termination; incomplete work never yields a success verdict.

Source

pub fn finish(&mut self) -> Result<CheckReport, DebugError>

Joins the existing checker and returns its ordinary typed report.

§Errors

A host failure or repeated finish request.

Trait Implementations§

Source§

impl Debug for Session

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Drop for Session

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.