MCPcopy Create free account
hub / github.com/SOVEREIGN-NET/The-Sovereign-Network / Output

Interface Output

zhtp-cli/src/output.rs:9–45  ·  view source on GitHub ↗

Output abstraction for printing results

Source from the content-addressed store, hash-verified

7
8/// Output abstraction for printing results
9pub trait Output: Send + Sync {
10 /// Print normal output
11 fn print(&self, msg: &str) -> CliResult<()>;
12
13 /// Print formatted JSON
14 fn print_json(&self, data: &serde_json::Value) -> CliResult<()> {
15 self.print(&serde_json::to_string_pretty(data)?)
16 }
17
18 /// Print error message
19 fn error(&self, msg: &str) -> CliResult<()>;
20
21 /// Print success message with checkmark
22 fn success(&self, msg: &str) -> CliResult<()> {
23 self.print(&format!("✅ {}", msg))
24 }
25
26 /// Print warning message
27 fn warning(&self, msg: &str) -> CliResult<()> {
28 self.print(&format!("⚠️ {}", msg))
29 }
30
31 /// Print info message
32 fn info(&self, msg: &str) -> CliResult<()> {
33 self.print(&format!("ℹ️ {}", msg))
34 }
35
36 /// Print a section header
37 fn header(&self, title: &str) -> CliResult<()> {
38 self.print(&format!("\n{}\n{}", title, "=".repeat(title.len())))
39 }
40
41 /// Print a subsection header
42 fn subheader(&self, title: &str) -> CliResult<()> {
43 self.print(&format!("\n{}\n{}", title, "-".repeat(title.len())))
44 }
45}
46
47/// Standard console output implementation
48pub struct ConsoleOutput;

Callers 1

full_diagnostics_implFunction · 0.80

Implementers 4

ConsoleOutputsdk-ts/src/output.ts
SilentOutputsdk-ts/src/output.ts
MockOutputsdk-ts/src/output.ts
output.rszhtp-cli/src/output.rs

Calls

no outgoing calls

Tested by

no test coverage detected