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
//! # wickra-terminal-core
//!
//! The data-driven core of the Wickra trading terminal. It folds market events
//! into an O(1) [`AppState`] and turns [`panels`] into [`view`]-models — plain
//! data (values, series, sides), never renderer commands. Two reference
//! renderers consume those view-models (a native TUI and a Web app), and the
//! same core is exposed as a JSON data API in ten languages.
//!
//! ## Shape
//!
//! - [`DataSource`] unifies the feed modules ([`Live`](source::LiveSource),
//! [`Replay`](source::ReplaySource), [`Synth`](source::SynthSource)) behind one
//! symbol-tagged `poll()`.
//! - [`AppState::fold`] applies one event incrementally; nothing is recomputed
//! over history.
//! - [`Panel`] maps state to a [`PanelView`]; a [`Frame`] is the set of them.
//! - [`Terminal`] ties it together, with [`Terminal::command_json`] as the
//! data-driven FFI boundary the bindings drive.
//!
//! ```
//! use wickra_terminal_core::{Config, SourceSpec, Terminal, Symbol};
//!
//! let mut cfg = Config::default_layout();
//! cfg.sources = vec![SourceSpec::Synth { seed: 1 }];
//! let mut term = Terminal::new(&cfg).unwrap();
//! term.subscribe(0, &Symbol::new("BTC", "USDT")).unwrap();
//! let frame = term.tick();
//! assert_eq!(frame.panels.len(), 5);
//! ```
// docs.rs builds with nightly and passes --cfg docsrs, so this turns on the
// feature-gate annotations there and nowhere else. `source::live` and
// `LiveSource` are behind the `live` feature; without this they render on
// docs.rs as though they were unconditional, because the manifest asks for
// all-features and nothing then says which items needed one.
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use Terminal;
pub use ;
/// The crate version (the same string [`Terminal::version`] returns).