@@ -148,6 +148,19 @@ struct StackTraceResponseBody {
148148 stack_frames: Vec<StackFrame>,
149149}
150150
151+#[derive(Debug, PartialEq, Clone, Deserialize, Serialize)]
152+#[serde(rename_all = "camelCase")]
153+pub struct Thread {
154+ id: usize,
155+ name: String,
156+}
157+
158+#[derive(Debug, PartialEq, Clone, Deserialize, Serialize)]
159+#[serde(rename_all = "camelCase")]
160+struct ThreadsResponseBody {
161+ threads: Vec<Thread>,
162+}
163+
151164#[derive(Debug)]
152165pub struct Client {
153166 id: usize,
@@ -349,4 +362,12 @@ impl Client {
349362
350363 Ok((body.stack_frames, body.total_frames))
351364 }
365+
366+ pub async fn threads(&mut self) -> Result<Vec<Thread>> {
367+ let response = self.request("threads".to_owned(), None).await?;
368+
369+ let body: ThreadsResponseBody = from_value(response.body.unwrap()).unwrap();
370+
371+ Ok(body.threads)
372+ }
352373}