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
//! # User Interface Module
//!
//! Provides interfaces and implementations for interacting with the debugger.
//!
//! This module defines the core user interface abstractions used by the debugger,
//! allowing for different interface implementations (such as CLI, JSON-RPC, etc.)
//! while maintaining a consistent API for the debugger core to interact with.
//!
//! The [`DebuggerUI`] trait defines the interface for UI implementations.
//!
//! This module also includes submodules for specific UI implementations:
//! - [`cli`]: A command-line interface implementation
use crateResult;
use crate;
/// Interface for debugger user interfaces
///
/// [`DebuggerUI`] defines the interface that must be implemented by any user
/// interface that wants to interact with the debugger. It provides a way for
/// the debugger to send feedback to the UI and receive commands in return.
///
/// # Examples
///
/// ```no_run
/// use coreminer::ui::DebuggerUI;
/// use coreminer::feedback::{Feedback,Status};
/// use coreminer::errors::Result;
///
/// // A simple UI implementation that always returns Continue
/// struct SimpleUI;
///
/// impl DebuggerUI for SimpleUI {
/// fn process(&mut self, feedback: Feedback) -> Result<Status> {
/// println!("Received feedback: {}", feedback);
/// Ok(Status::Continue)
/// }
/// }
///
/// // Using the UI with a debugger
/// # fn run_example() -> Result<()> {
/// # use coreminer::debugger::Debugger;
/// let ui = SimpleUI;
/// let mut debugger = Debugger::build(ui)?;
/// debugger.run_debugger()?;
/// debugger.cleanup()?;
/// # Ok(())
/// # }
/// ```