dap: All of these calls don't need &mut

pull/574/head
Blaž Hrastnik 3 years ago
parent 43fbb6d965
commit bcf70d8e67

@ -284,7 +284,7 @@ impl Client {
Ok(()) Ok(())
} }
pub async fn disconnect(&mut self) -> Result<()> { pub async fn disconnect(&self) -> Result<()> {
self.request::<requests::Disconnect>(()).await self.request::<requests::Disconnect>(()).await
} }
@ -297,7 +297,7 @@ impl Client {
} }
pub async fn set_breakpoints( pub async fn set_breakpoints(
&mut self, &self,
file: PathBuf, file: PathBuf,
breakpoints: Vec<SourceBreakpoint>, breakpoints: Vec<SourceBreakpoint>,
) -> Result<Option<Vec<Breakpoint>>> { ) -> Result<Option<Vec<Breakpoint>>> {
@ -321,11 +321,11 @@ impl Client {
Ok(response.breakpoints) Ok(response.breakpoints)
} }
pub async fn configuration_done(&mut self) -> Result<()> { pub async fn configuration_done(&self) -> Result<()> {
self.request::<requests::ConfigurationDone>(()).await self.request::<requests::ConfigurationDone>(()).await
} }
pub async fn continue_thread(&mut self, thread_id: ThreadId) -> Result<Option<bool>> { pub async fn continue_thread(&self, thread_id: ThreadId) -> Result<Option<bool>> {
let args = requests::ContinueArguments { thread_id }; let args = requests::ContinueArguments { thread_id };
let response = self.request::<requests::Continue>(args).await?; let response = self.request::<requests::Continue>(args).await?;
@ -333,7 +333,7 @@ impl Client {
} }
pub async fn stack_trace( pub async fn stack_trace(
&mut self, &self,
thread_id: ThreadId, thread_id: ThreadId,
) -> Result<(Vec<StackFrame>, Option<usize>)> { ) -> Result<(Vec<StackFrame>, Option<usize>)> {
let args = requests::StackTraceArguments { let args = requests::StackTraceArguments {
@ -347,19 +347,19 @@ impl Client {
Ok((response.stack_frames, response.total_frames)) Ok((response.stack_frames, response.total_frames))
} }
pub async fn threads(&mut self) -> Result<Vec<Thread>> { pub async fn threads(&self) -> Result<Vec<Thread>> {
let response = self.request::<requests::Threads>(()).await?; let response = self.request::<requests::Threads>(()).await?;
Ok(response.threads) Ok(response.threads)
} }
pub async fn scopes(&mut self, frame_id: usize) -> Result<Vec<Scope>> { pub async fn scopes(&self, frame_id: usize) -> Result<Vec<Scope>> {
let args = requests::ScopesArguments { frame_id }; let args = requests::ScopesArguments { frame_id };
let response = self.request::<requests::Scopes>(args).await?; let response = self.request::<requests::Scopes>(args).await?;
Ok(response.scopes) Ok(response.scopes)
} }
pub async fn variables(&mut self, variables_reference: usize) -> Result<Vec<Variable>> { pub async fn variables(&self, variables_reference: usize) -> Result<Vec<Variable>> {
let args = requests::VariablesArguments { let args = requests::VariablesArguments {
variables_reference, variables_reference,
filter: None, filter: None,
@ -372,7 +372,7 @@ impl Client {
Ok(response.variables) Ok(response.variables)
} }
pub async fn step_in(&mut self, thread_id: ThreadId) -> Result<()> { pub async fn step_in(&self, thread_id: ThreadId) -> Result<()> {
let args = requests::StepInArguments { let args = requests::StepInArguments {
thread_id, thread_id,
target_id: None, target_id: None,
@ -382,7 +382,7 @@ impl Client {
self.request::<requests::StepIn>(args).await self.request::<requests::StepIn>(args).await
} }
pub async fn step_out(&mut self, thread_id: ThreadId) -> Result<()> { pub async fn step_out(&self, thread_id: ThreadId) -> Result<()> {
let args = requests::StepOutArguments { let args = requests::StepOutArguments {
thread_id, thread_id,
granularity: None, granularity: None,
@ -391,7 +391,7 @@ impl Client {
self.request::<requests::StepOut>(args).await self.request::<requests::StepOut>(args).await
} }
pub async fn next(&mut self, thread_id: ThreadId) -> Result<()> { pub async fn next(&self, thread_id: ThreadId) -> Result<()> {
let args = requests::NextArguments { let args = requests::NextArguments {
thread_id, thread_id,
granularity: None, granularity: None,
@ -400,14 +400,14 @@ impl Client {
self.request::<requests::Next>(args).await self.request::<requests::Next>(args).await
} }
pub async fn pause(&mut self, thread_id: ThreadId) -> Result<()> { pub async fn pause(&self, thread_id: ThreadId) -> Result<()> {
let args = requests::PauseArguments { thread_id }; let args = requests::PauseArguments { thread_id };
self.request::<requests::Pause>(args).await self.request::<requests::Pause>(args).await
} }
pub async fn eval( pub async fn eval(
&mut self, &self,
expression: String, expression: String,
frame_id: Option<usize>, frame_id: Option<usize>,
) -> Result<requests::EvaluateResponse> { ) -> Result<requests::EvaluateResponse> {
@ -422,7 +422,7 @@ impl Client {
} }
pub async fn set_exception_breakpoints( pub async fn set_exception_breakpoints(
&mut self, &self,
filters: Vec<String>, filters: Vec<String>,
) -> Result<Option<Vec<Breakpoint>>> { ) -> Result<Option<Vec<Breakpoint>>> {
let args = requests::SetExceptionBreakpointsArguments { filters }; let args = requests::SetExceptionBreakpointsArguments { filters };

Loading…
Cancel
Save