Skip to main content

DapClient

Struct DapClient 

Source
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: bool

Panel visible in the UI layout (independent of focus / Mode::Debug).

§location_dirty: bool

Set 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: String

Console REPL input line (evaluate request).

§build_message: Option<String>

Status line while building (“cargo build…”).

Implementations§

Source§

impl DapClient

Source

pub fn new() -> Self

Source

pub fn is_session(&self) -> bool

Source

pub fn arm_panel_animation(&mut self)

Arm the slide-up; the clock starts on the first rendered frame.

Source

pub fn anim_progress(&mut self) -> f32

Source

pub fn log(&mut self, msg: impl Into<String>)

Source

pub fn toggle_breakpoint(&mut self, path: &str, line: usize) -> bool

Toggle breakpoint at 0-based line for path. Returns new state (true = on).

Source

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.

Source

pub fn set_breakpoint_log( &mut self, path: &str, line: usize, log_message: Option<String>, )

Set / clear a logpoint message.

Source

pub fn has_breakpoint(&mut self, path: &str, line: usize) -> bool

Source

pub fn clear_breakpoints(&mut self)

Source

pub fn persist_breakpoints(&self) -> Result<(), String>

Persist BPs to ~/.xei/breakpoints (path|line[:cond][:log=msg]).

Source

pub fn load_persisted_breakpoints(&mut self)

Load BPs from ~/.xei/breakpoints (merge into current map).

Source

pub fn lines_for(&mut self, path: &str) -> Vec<usize>

All BP lines for a path (0-based).

Source

pub fn current_line_for(&mut self, path: &str) -> Option<usize>

Stopped line if the session is currently stopped in path.

Source

pub fn shift_breakpoints(&mut self, path: &str, anchor: usize, delta: isize)

Best-effort line tracking for buffer edits.

  • Insert (delta > 0): anchor is the line after which content was inserted (e.g. newline at end of anchor). BPs on anchor stay; BPs with line > anchor shift down by delta.
  • Delete (delta < 0): anchor is the first deleted line (inclusive). BPs in [anchor, anchor+|delta|) are removed; later lines shift up.

Live-updates the adapter mid-session.

Source

pub fn flat_bps(&self) -> Vec<(String, usize, bool)>

Flattened BP list for UI: (path, line 0-based, verified)

Source

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).

Source

pub fn attach_pid(&mut self, pid: u32) -> Result<(), String>

Attach to a running process by PID (lldb-dap / codelldb).

Source

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 connect
  • node → js-debug TCP server + attach
  • native / default → lldb-dap attach via connect (when supported)
Source

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).

Source

pub fn continue_exec(&mut self)

Source

pub fn step_over(&mut self)

Source

pub fn step_into(&mut self)

Source

pub fn step_out(&mut self)

Source

pub fn pause(&mut self)

Suspend a running program (F6).

Source

pub fn stop(&mut self)

Graceful stop: terminate/disconnect, then SIGKILL after [SHUTDOWN_GRACE] (enforced in poll). Pressing stop twice force-kills.

Source

pub fn restart(&mut self) -> Result<(), String>

Queue a relaunch; it fires from poll() once the graceful stop lands.

Source

pub fn evaluate(&mut self, expression: &str)

Evaluate expression in the current stopped frame (REPL / watch).

Source

pub fn select_frame(&mut self, idx: usize)

Select stack frame by index and load its scopes.

Source

pub fn toggle_var_at(&mut self, idx: usize)

Expand/collapse the Variables tree node at idx.

Source

pub fn move_focus(&mut self, delta: isize)

Move panel focus; selection only — network requests stay on Enter.

Source

pub fn set_pane(&mut self, pane: DebugPane)

Switch pane, placing focus sensibly (console starts at the tail).

Source

pub fn poll(&mut self)

Trait Implementations§

Source§

impl Default for DapClient

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert 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>

Convert 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)

Convert &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)

Convert &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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.