[−][src]Crate interact
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.
Modules
access | |
climber | |
deser | |
root |
Structs
Assist | Given a list of items, this provides assistance for completing them. |
Climber | Climber represents the full state of evaluation of Interact expressions. It is used within the
impls of the |
ImmutAccess | ImmutAccess adds function call information over |
MutAccess | MutAccess adds function call information over |
NodeTree | NodeTree represent a reflection of an Interact type that implemented the |
Reflector |
|
Root | A temporary binder of |
RootLocal | Holds a root dictionary of trait objects that implement |
RootSend | Holds a root dictionary of |
Token | Represents a single meaningful substring part in an Interact string expression. |
TokenVec | Wrapper for the traversal of a borrowed list of tokens. |
Enums
AssignError | |
CallError | |
ClimbError | |
NextOptions | |
NodeInfo | |
Reflect | An arbitrar between the two possible way to climb into an immutable value. |
ReflectMut | An arbitrar between the two possible way to climb into a mutable value. |
TokenKind |
Traits
Access | The |
Deser | |
ReflectDirect | The direct Reflect allows direct climber or reflector access, and meant to be used as a trait object for that purpose. |
ReflectIndirect | The indirect Reflect allows indirect climber or reflector access, and meant to be used as a trait object for that purpose. |
Functions
deser_assign | A helper for the specific implementations of |
Type Definitions
RetValCallback |
Derive Macros
Interact | Attributes that Interact derive macro supports |