Skip to main content

shape_wire/
lib.rs

1//! Shape Wire Format
2//!
3//! Universal serialization format for Shape values with type metadata.
4//! This crate provides the data exchange format for:
5//! - REPL communication (engine <-> CLI)
6//! - fchart interoperability
7//! - Plugin data exchange
8//! - External tool integration
9//!
10//! # Design Goals
11//!
12//! 1. **Fast**: Uses MessagePack for compact binary serialization
13//! 2. **Type-aware**: Carries type metadata for proper display/parsing
14//! 3. **Format-flexible**: Supports multiple display formats per type
15//! 4. **Lossless**: Raw values can be round-tripped without data loss
16
17pub mod any_error;
18pub mod codec;
19pub mod envelope;
20pub mod error;
21pub mod formatter;
22pub mod metadata;
23pub mod print_result;
24pub mod render;
25pub mod transport;
26pub mod value;
27
28pub use any_error::{
29    AnsiAnyErrorRenderer, AnyError, AnyErrorFrame, AnyErrorRenderer, HtmlAnyErrorRenderer,
30    PlainAnyErrorRenderer, render_any_error_ansi, render_any_error_html, render_any_error_plain,
31    render_any_error_terminal, render_any_error_with,
32};
33pub use codec::{
34    decode, decode_message, encode, encode_message, from_json, from_json_string, to_json,
35    to_json_string, to_json_string_pretty,
36};
37pub use envelope::ValueEnvelope;
38pub use error::{Result, WireError};
39pub use formatter::{format_value, parse_value};
40pub use metadata::{FieldInfo, TypeInfo, TypeKind, TypeMetadata, TypeRegistry};
41pub use print_result::{WirePrintResult, WirePrintSpan};
42pub use render::{
43    AnyErrorWireRenderAdapter, TerminalRenderCaps, WireRenderAdapter, WireRenderer,
44    render_wire_html, render_wire_terminal,
45};
46pub use value::{DurationUnit, WireColumn, WireTable, WireValue};