pub struct DapClient {Show 26 fields
pub state: DapState,
pub adapter_name: String,
pub error: Option<String>,
pub soft_error: Option<String>,
pub breakpoints: HashMap<String, Vec<Breakpoint>>,
pub stack: Vec<StackFrameInfo>,
pub vars: Vec<VarNode>,
pub console: Vec<String>,
pub threads: Vec<(i64, String)>,
pub selected_frame: usize,
pub selected_bp: usize,
pub pane: DebugPane,
pub focus_row: usize,
pub thread_id: Option<i64>,
pub stopped_reason: Option<String>,
pub current_path: Option<String>,
pub current_line: Option<usize>,
pub panel_open: bool,
pub location_dirty: bool,
pub last_program: Option<String>,
pub last_cwd: Option<String>,
pub last_lang: Option<String>,
pub last_args: Vec<String>,
pub last_attach: Option<String>,
pub eval_input: String,
pub build_message: Option<String>,
/* private fields */
}Fields§
§state: DapState§adapter_name: String§error: Option<String>§soft_error: Option<String>Soft hint (adapter missing, etc.)
breakpoints: HashMap<String, Vec<Breakpoint>>canonical path → breakpoints (0-based lines)
stack: Vec<StackFrameInfo>§vars: Vec<VarNode>Flattened Variables tree (scope roots + expanded children).
console: Vec<String>§threads: Vec<(i64, String)>(thread id, name) from the last threads response / thread events.
selected_frame: usize§selected_bp: usize§pane: DebugPane§focus_row: usize§thread_id: Option<i64>§stopped_reason: Option<String>§current_path: Option<String>Current stopped location (path, 0-based line)
current_line: Option<usize>§panel_open: boolPanel visible in the UI layout (independent of focus / Mode::Debug).
location_dirty: boolSet when stopped location changes — TUI should jump editor once.
last_program: Option<String>Program + args for last launch (for restart)
last_cwd: Option<String>§last_lang: Option<String>§last_args: Vec<String>§last_attach: Option<String>Last attach target for restart (e.g. “pid:1234” / “port:5678”)
eval_input: StringConsole REPL input line (evaluate request).
build_message: Option<String>Status line while building (“cargo build…”).
Implementations§
Source§impl DapClient
impl DapClient
pub fn new() -> Self
pub fn is_session(&self) -> bool
Sourcepub fn arm_panel_animation(&mut self)
pub fn arm_panel_animation(&mut self)
Arm the slide-up; the clock starts on the first rendered frame.
pub fn anim_progress(&mut self) -> f32
pub fn log(&mut self, msg: impl Into<String>)
Sourcepub fn toggle_breakpoint(&mut self, path: &str, line: usize) -> bool
pub fn toggle_breakpoint(&mut self, path: &str, line: usize) -> bool
Toggle breakpoint at 0-based line for path. Returns new state (true = on).
Sourcepub fn set_breakpoint_condition(
&mut self,
path: &str,
line: usize,
condition: Option<String>,
)
pub fn set_breakpoint_condition( &mut self, path: &str, line: usize, condition: Option<String>, )
Set / clear a condition on an existing BP (0-based line). Creates BP if missing.
Sourcepub fn set_breakpoint_log(
&mut self,
path: &str,
line: usize,
log_message: Option<String>,
)
pub fn set_breakpoint_log( &mut self, path: &str, line: usize, log_message: Option<String>, )
Set / clear a logpoint message.
pub fn has_breakpoint(&mut self, path: &str, line: usize) -> bool
pub fn clear_breakpoints(&mut self)
Sourcepub fn persist_breakpoints(&self) -> Result<(), String>
pub fn persist_breakpoints(&self) -> Result<(), String>
Persist BPs to ~/.xei/breakpoints (path|line[:cond][:log=msg]).
Sourcepub fn load_persisted_breakpoints(&mut self)
pub fn load_persisted_breakpoints(&mut self)
Load BPs from ~/.xei/breakpoints (merge into current map).
Sourcepub fn current_line_for(&mut self, path: &str) -> Option<usize>
pub fn current_line_for(&mut self, path: &str) -> Option<usize>
Stopped line if the session is currently stopped in path.
Sourcepub fn shift_breakpoints(&mut self, path: &str, anchor: usize, delta: isize)
pub fn shift_breakpoints(&mut self, path: &str, anchor: usize, delta: isize)
Best-effort line tracking for buffer edits.
- Insert (
delta > 0):anchoris the line after which content was inserted (e.g. newline at end ofanchor). BPs onanchorstay; BPs withline > anchorshift down bydelta. - Delete (
delta < 0):anchoris the first deleted line (inclusive). BPs in[anchor, anchor+|delta|)are removed; later lines shift up.
Live-updates the adapter mid-session.
Sourcepub fn flat_bps(&self) -> Vec<(String, usize, bool)>
pub fn flat_bps(&self) -> Vec<(String, usize, bool)>
Flattened BP list for UI: (path, line 0-based, verified)
Sourcepub fn start(
&mut self,
program: &str,
cwd: Option<&Path>,
lang_hint: Option<&str>,
args: &[String],
) -> Result<(), String>
pub fn start( &mut self, program: &str, cwd: Option<&Path>, lang_hint: Option<&str>, args: &[String], ) -> Result<(), String>
Start debugging program (or current file for script langs).
Sourcepub fn attach_pid(&mut self, pid: u32) -> Result<(), String>
pub fn attach_pid(&mut self, pid: u32) -> Result<(), String>
Attach to a running process by PID (lldb-dap / codelldb).
Sourcepub fn attach_port(
&mut self,
port: u16,
lang_hint: Option<&str>,
host: Option<&str>,
) -> Result<(), String>
pub fn attach_port( &mut self, port: u16, lang_hint: Option<&str>, host: Option<&str>, ) -> Result<(), String>
Attach to a debug adapter / runtime listening on host:port.
python→ debugpy.adapter stdio + attach connectnode→ js-debug TCP server + attachnative/ default → lldb-dap attach via connect (when supported)
Sourcepub fn start_node(
&mut self,
program: &str,
cwd: Option<&Path>,
args: &[String],
) -> Result<(), String>
pub fn start_node( &mut self, program: &str, cwd: Option<&Path>, args: &[String], ) -> Result<(), String>
Launch a Node/JS program via js-debug over TCP (stdio is unsupported).
pub fn continue_exec(&mut self)
pub fn step_over(&mut self)
pub fn step_into(&mut self)
pub fn step_out(&mut self)
Sourcepub fn stop(&mut self)
pub fn stop(&mut self)
Graceful stop: terminate/disconnect, then SIGKILL after [SHUTDOWN_GRACE]
(enforced in poll). Pressing stop twice force-kills.
Sourcepub fn restart(&mut self) -> Result<(), String>
pub fn restart(&mut self) -> Result<(), String>
Queue a relaunch; it fires from poll() once the graceful stop lands.
Sourcepub fn evaluate(&mut self, expression: &str)
pub fn evaluate(&mut self, expression: &str)
Evaluate expression in the current stopped frame (REPL / watch).
Sourcepub fn select_frame(&mut self, idx: usize)
pub fn select_frame(&mut self, idx: usize)
Select stack frame by index and load its scopes.
Sourcepub fn toggle_var_at(&mut self, idx: usize)
pub fn toggle_var_at(&mut self, idx: usize)
Expand/collapse the Variables tree node at idx.
Sourcepub fn move_focus(&mut self, delta: isize)
pub fn move_focus(&mut self, delta: isize)
Move panel focus; selection only — network requests stay on Enter.
Sourcepub fn set_pane(&mut self, pane: DebugPane)
pub fn set_pane(&mut self, pane: DebugPane)
Switch pane, placing focus sensibly (console starts at the tail).
pub fn poll(&mut self)
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for DapClient
impl !Sync for DapClient
impl !UnwindSafe for DapClient
impl Freeze for DapClient
impl Send for DapClient
impl Unpin for DapClient
impl UnsafeUnpin for DapClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more