Skip to main content

Crate spytial

Crate spytial 

Source
Expand description

Spytial is a drop-in replacement for std::dbg! that opens an interactive diagram of Rust values in the browser.

The crate-level entry points are dbg! (a strict superset of std::dbg!) and diagram (no stderr, doesn’t move). Both work on any type that derives std::fmt::Debug, serde::Serialize, and SpytialDecorators.

Start with the guide at https://sidprasad.github.io/spytial-rust/ for the tutorial, decorator reference, and architecture notes. The README on GitHub has the elevator pitch.

Re-exports§

pub use export::export_json_instance;
pub use reify::from_datum;
pub use reify::from_datum_root;
pub use reify::replit;
pub use reify::replit_root;
pub use reify::ReifyError;

Modules§

export
Serde-driven export of Rust values into the relational jsondata shape. Serialize Rust values into the atom/relation form the visualizer consumes (JsonDataInstance).
jsondata
Serializable atom/relation data model consumed by spytial-core. Relational JSON data model produced by crate::export_json_instance.
reify
Reconstruct Rust values from the relational jsondata shape (inverse of export). Reconstructing Rust values from the relational jsondata shape — the inverse of crate::export.
spytial_annotations
SpyTial decorator types, derive-macro runtime, and YAML serialization.

Macros§

dbg
Strict superset of std::dbg!: prints the Debug representation to stderr and opens an interactive diagram of the value in your browser.

Functions§

diagram
Render value as an interactive diagram and open it in the browser.
diagram_with_spec
Like diagram, but renders value against a caller-supplied SpyTial spec instead of the decorators collected from the type.

Derive Macros§

SpytialDecorators
Derive HasSpytialDecorators, turning a type’s spatial-annotation attributes into a single decorators() impl that also pulls in the decorators of nested field types.