pub struct DapClient { /* private fields */ }Expand description
High-level DAP client managing a single debug session.
Wraps DapTransport and tracks session state, capabilities,
and active breakpoints.
Implementations§
Source§impl DapClient
impl DapClient
Sourcepub fn start(
config: &DapAdapterConfig,
event_handler: EventHandler,
) -> Result<Self, DapError>
pub fn start( config: &DapAdapterConfig, event_handler: EventHandler, ) -> Result<Self, DapError>
Spawn an adapter process and create a new client.
This only starts the child process. Call initialize
afterwards to perform the DAP handshake.
§Errors
Returns DapError::BinaryNotFound if the command is not on PATH,
or DapError::Io if the process fails to spawn.
Sourcepub async fn initialize(&self) -> Result<(), DapError>
pub async fn initialize(&self) -> Result<(), DapError>
Perform the DAP initialize handshake.
Sends initialize, stores the adapter’s capabilities, then sends
configurationDone.
§Errors
Returns DapError::InitializationFailed if the handshake fails.
Sourcepub async fn disconnect(&self) -> Result<(), DapError>
pub async fn disconnect(&self) -> Result<(), DapError>
Sourcepub async fn set_breakpoints(
&self,
source_path: &str,
lines: &[i64],
) -> Result<Vec<Value>, DapError>
pub async fn set_breakpoints( &self, source_path: &str, lines: &[i64], ) -> Result<Vec<Value>, DapError>
Sourcepub async fn set_function_breakpoints(
&self,
names: &[String],
) -> Result<Vec<Value>, DapError>
pub async fn set_function_breakpoints( &self, names: &[String], ) -> Result<Vec<Value>, DapError>
Sourcepub async fn evaluate(
&self,
expression: &str,
frame_id: Option<i64>,
) -> Result<Value, DapError>
pub async fn evaluate( &self, expression: &str, frame_id: Option<i64>, ) -> Result<Value, DapError>
Sourcepub async fn status(&self) -> DapSessionState
pub async fn status(&self) -> DapSessionState
Return the current session state.
Sourcepub async fn capabilities(&self) -> Option<Value>
pub async fn capabilities(&self) -> Option<Value>
Return the adapter capabilities received during initialization.
Sourcepub const fn transport(&self) -> &Arc<DapTransport>
pub const fn transport(&self) -> &Arc<DapTransport>
Return a reference to the underlying transport.
Auto Trait Implementations§
impl !Freeze for DapClient
impl !RefUnwindSafe for DapClient
impl Send for DapClient
impl Sync for DapClient
impl Unpin for DapClient
impl UnsafeUnpin for DapClient
impl !UnwindSafe 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
Mutably borrows from an owned value. Read more
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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 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>
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