Com protocol

This commit is contained in:
2026-07-22 14:17:07 +02:00
parent 5affe1adf0
commit 23a1949676
11 changed files with 329 additions and 141 deletions
+9 -16
View File
@@ -12,22 +12,15 @@ impl Formatted for InspectTarget {
match self {
Self::None => vec!["\x1b[2mnothing to inspect\x1b[0m".to_string()],
Self::Symbol(boxed) => {
let (watch, overview) = &**boxed;
vec![
Property("Symbol", format!("\x1b[35m{}\x1b[0m", watch.symbol)),
Property("Price", format!("\x1b[96m{}\x1b[0m", format_f64(watch.price))),
Property("Trend", format!("{}", format_f64(watch.trend))),
Property("Market", format!("{}", overview.trend)),
Property("Volatility", format!("{}", overview.volatility)),
Property(
"Pressure",
format!("{:+.2}%", overview.pressure * 100.0),
),
Property("Alerts", format!("{}", overview.alerts.len())),
]
.get_formatted()
}
Self::Symbol(watch) => vec![
Property("Symbol", format!("\x1b[35m{}\x1b[0m", watch.symbol)),
Property(
"Price",
format!("\x1b[96m{}\x1b[0m", format_f64(watch.price)),
),
Property("Trend", format!("{}", format_f64(watch.trend))),
]
.get_formatted(),
Self::Position(pos) => vec![
Property("Symbol", format!("\x1b[35m{}\x1b[0m", pos.symbol)),