1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
//! # inspect-rs
//!
//! Universal introspection for Rust.
//!
//! `inspect-rs` provides a lightweight protocol for structured introspection
//! of Rust values without coupling to debuggers, serializers, or specific
//! UI frameworks.
//!
//! ## Quick Start
//!
//! ```
//! use inspect_rs::Inspect;
//!
//! #[derive(Inspect)]
//! struct User {
//! id: u64,
//! name: String,
//! active: bool,
//! }
//!
//! let user = User {
//! id: 42,
//! name: "Alice".to_string(),
//! active: true,
//! };
//!
//! let mut cx = inspect_rs::InspectCx::new();
//! let inspected = user.inspect(&mut cx);
//!
//! println!("{}", inspect_rs::format_tree(&inspected));
//! ```
//!
//! ## Design Principles
//!
//! - **Lazy**: Values are not eagerly traversed
//! - **Zero-copy**: Borrows from original values where possible
//! - **Safe**: Handles cycles, respects limits, protects secrets
//! - **Minimal**: Zero runtime dependencies in core
//! - **Semantic Styling**: Restrained, accessible, terminal-aware colored output
pub use ;
pub use Inspect;
pub use ;
pub use ;
/// Format an inspected value as a tree with automatic terminal color detection.
///
/// If stdout is a TTY and environment variables allow it, semantic colors are applied.
/// If output is redirected to a file or pipe, colors are automatically omitted.
///
/// # Example
///
/// ```
/// use inspect_rs::{Inspect, InspectCx, format_tree};
///
/// let value = vec![1, 2, 3];
/// let mut cx = InspectCx::new();
/// let inspected = value.inspect(&mut cx);
///
/// println!("{}", format_tree(&inspected));
/// ```
/// Format an inspected value as a compact tree.
/// Format an inspected value as a tree with ANSI color codes explicitly enabled.
/// Format an inspected value as a tree with ANSI color codes explicitly disabled.
/// Format an inspected value as a tree using a custom [`TreeConfig`].