9 releases

0.3.6 May 18, 2020
0.3.5 Apr 28, 2019
0.3.1 Mar 7, 2019
0.3.0 Jan 25, 2019
0.1.0 Jan 14, 2019

#620 in Command-line interface

45 downloads per month
Used in interact_prompt

MIT/Apache

115KB
3K SLoC

Interact is a framework for friendly online introspection of the running program state in an intuitive command-line interactive way.

Please go to the homepage for more details.


lib.rs:

Interact

Interact is a framework for friendly online introspection of the running program state in an intuitive command-line interactive way.

While dynamically-typed interpreted languages offer the advantage of allowing to look at a running program state using a prompt, compiled languages often do not provide that feature. Being hard as it is to introduce interpreters into compiled languages, the Interact project aimes to provide a midway solution using stable Rust.

Usage

NOTE: Unless you are manually extending types for use under Interact, you probably don't need most of the items that are exported in this crate. Instead, look for the interact_prompt crate.

Design

Interact introduces a series of traits, the main ones are Access and Deser trait. Those crates can be custom-derived using #[derive(Interact)], or be derived manually.

The Access provides two methods that return special accessor trait object types. Please read the documentation for the access part of Interact.

The Deser trait is a special deserializer that allows for online interactive hints at non-ambiguous parse points.

Further relevent bits that comprise Interact are:

  • reflector, when provided at type it will generate a representation of it, while handling reference cycles, imposed output limitations, mutexs, and customized in-process indirections.
  • climber, which when given a Rust-like expression of an inner value, knows how to go from an Interact root down to a field.

Dependencies

~4MB
~82K SLoC