| 1 |
use serde::{Deserialize, Deserializer, Serialize}; |
| 2 |
use serde_json::Value; |
| 3 |
use std::collections::HashMap; |
| 4 |
use std::path::PathBuf; |
| 5 |
|
| 6 |
#[derive( |
| 7 |
Debug, Default, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Deserialize, Serialize, |
| 8 |
)] |
| 9 |
pub struct ThreadId(isize); |
| 10 |
|
| 11 |
impl std::fmt::Display for ThreadId { |
| 12 |
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
| 13 |
self.0.fmt(f) |
| 14 |
} |
| 15 |
} |
| 16 |
|
| 17 |
pub type ThreadStates = HashMap<ThreadId, String>; |
| 18 |
|
| 19 |
pub trait Request { |
| 20 |
type Arguments: serde::de::DeserializeOwned + serde::Serialize; |
| 21 |
type Result: serde::de::DeserializeOwned + serde::Serialize; |
| 22 |
const COMMAND: &'static str; |
| 23 |
} |
| 24 |
|
| 25 |
#[derive(Debug, PartialEq, Eq, Clone, Deserialize, Serialize)] |
| 26 |
#[serde(rename_all = "camelCase")] |
| 27 |
pub struct ColumnDescriptor { |
| 28 |
pub attribute_name: String, |
| 29 |
pub label: String, |
| 30 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 31 |
pub format: Option<String>, |
| 32 |
#[serde(rename = "type", skip_serializing_if = "Option::is_none")] |
| 33 |
pub ty: Option<String>, |
| 34 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 35 |
pub width: Option<usize>, |
| 36 |
} |
| 37 |
|
| 38 |
#[derive(Debug, PartialEq, Eq, Clone, Deserialize, Serialize)] |
| 39 |
#[serde(rename_all = "camelCase")] |
| 40 |
pub struct ExceptionBreakpointsFilter { |
| 41 |
pub filter: String, |
| 42 |
pub label: String, |
| 43 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 44 |
pub description: Option<String>, |
| 45 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 46 |
pub default: Option<bool>, |
| 47 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 48 |
pub supports_condition: Option<bool>, |
| 49 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 50 |
pub condition_description: Option<String>, |
| 51 |
} |
| 52 |
|
| 53 |
#[derive(Debug, PartialEq, Eq, Clone, Deserialize, Serialize)] |
| 54 |
#[serde(rename_all = "camelCase")] |
| 55 |
pub struct DebuggerCapabilities { |
| 56 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 57 |
pub supports_configuration_done_request: Option<bool>, |
| 58 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 59 |
pub supports_function_breakpoints: Option<bool>, |
| 60 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 61 |
pub supports_conditional_breakpoints: Option<bool>, |
| 62 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 63 |
pub supports_hit_conditional_breakpoints: Option<bool>, |
| 64 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 65 |
pub supports_evaluate_for_hovers: Option<bool>, |
| 66 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 67 |
pub supports_step_back: Option<bool>, |
| 68 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 69 |
pub supports_set_variable: Option<bool>, |
| 70 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 71 |
pub supports_restart_frame: Option<bool>, |
| 72 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 73 |
pub supports_goto_targets_request: Option<bool>, |
| 74 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 75 |
pub supports_step_in_targets_request: Option<bool>, |
| 76 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 77 |
pub supports_completions_request: Option<bool>, |
| 78 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 79 |
pub supports_modules_request: Option<bool>, |
| 80 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 81 |
pub supports_restart_request: Option<bool>, |
| 82 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 83 |
pub supports_exception_options: Option<bool>, |
| 84 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 85 |
pub supports_value_formatting_options: Option<bool>, |
| 86 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 87 |
pub supports_exception_info_request: Option<bool>, |
| 88 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 89 |
pub support_terminate_debuggee: Option<bool>, |
| 90 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 91 |
pub support_suspend_debuggee: Option<bool>, |
| 92 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 93 |
pub supports_delayed_stack_trace_loading: Option<bool>, |
| 94 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 95 |
pub supports_loaded_sources_request: Option<bool>, |
| 96 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 97 |
pub supports_log_points: Option<bool>, |
| 98 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 99 |
pub supports_terminate_threads_request: Option<bool>, |
| 100 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 101 |
pub supports_set_expression: Option<bool>, |
| 102 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 103 |
pub supports_terminate_request: Option<bool>, |
| 104 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 105 |
pub supports_data_breakpoints: Option<bool>, |
| 106 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 107 |
pub supports_read_memory_request: Option<bool>, |
| 108 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 109 |
pub supports_write_memory_request: Option<bool>, |
| 110 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 111 |
pub supports_disassemble_request: Option<bool>, |
| 112 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 113 |
pub supports_cancel_request: Option<bool>, |
| 114 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 115 |
pub supports_breakpoint_locations_request: Option<bool>, |
| 116 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 117 |
pub supports_clipboard_context: Option<bool>, |
| 118 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 119 |
pub supports_stepping_granularity: Option<bool>, |
| 120 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 121 |
pub supports_instruction_breakpoints: Option<bool>, |
| 122 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 123 |
pub supports_exception_filter_options: Option<bool>, |
| 124 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 125 |
pub exception_breakpoint_filters: Option<Vec<ExceptionBreakpointsFilter>>, |
| 126 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 127 |
pub completion_trigger_characters: Option<Vec<String>>, |
| 128 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 129 |
pub additional_module_columns: Option<Vec<ColumnDescriptor>>, |
| 130 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 131 |
pub supported_checksum_algorithms: Option<Vec<String>>, |
| 132 |
} |
| 133 |
|
| 134 |
#[derive(Debug, PartialEq, Eq, Clone, Deserialize, Serialize)] |
| 135 |
#[serde(rename_all = "camelCase")] |
| 136 |
pub struct Checksum { |
| 137 |
pub algorithm: String, |
| 138 |
pub checksum: String, |
| 139 |
} |
| 140 |
|
| 141 |
#[derive(Debug, Default, PartialEq, Eq, Clone, Deserialize, Serialize)] |
| 142 |
#[serde(rename_all = "camelCase")] |
| 143 |
pub struct Source { |
| 144 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 145 |
pub name: Option<String>, |
| 146 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 147 |
pub path: Option<PathBuf>, |
| 148 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 149 |
pub source_reference: Option<usize>, |
| 150 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 151 |
pub presentation_hint: Option<String>, |
| 152 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 153 |
pub origin: Option<String>, |
| 154 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 155 |
pub sources: Option<Vec<Source>>, |
| 156 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 157 |
pub adapter_data: Option<Value>, |
| 158 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 159 |
pub checksums: Option<Vec<Checksum>>, |
| 160 |
} |
| 161 |
|
| 162 |
#[derive(Debug, Default, PartialEq, Eq, Clone, Deserialize, Serialize)] |
| 163 |
#[serde(rename_all = "camelCase")] |
| 164 |
pub struct SourceBreakpoint { |
| 165 |
pub line: usize, |
| 166 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 167 |
pub column: Option<usize>, |
| 168 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 169 |
pub condition: Option<String>, |
| 170 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 171 |
pub hit_condition: Option<String>, |
| 172 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 173 |
pub log_message: Option<String>, |
| 174 |
} |
| 175 |
|
| 176 |
#[derive(Debug, PartialEq, Eq, Clone, Deserialize, Serialize)] |
| 177 |
#[serde(rename_all = "camelCase")] |
| 178 |
pub struct Breakpoint { |
| 179 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 180 |
pub id: Option<usize>, |
| 181 |
pub verified: bool, |
| 182 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 183 |
pub message: Option<String>, |
| 184 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 185 |
pub source: Option<Source>, |
| 186 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 187 |
pub line: Option<usize>, |
| 188 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 189 |
pub column: Option<usize>, |
| 190 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 191 |
pub end_line: Option<usize>, |
| 192 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 193 |
pub end_column: Option<usize>, |
| 194 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 195 |
pub instruction_reference: Option<String>, |
| 196 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 197 |
pub offset: Option<usize>, |
| 198 |
} |
| 199 |
|
| 200 |
#[derive(Debug, PartialEq, Eq, Clone, Deserialize, Serialize)] |
| 201 |
#[serde(rename_all = "camelCase")] |
| 202 |
pub struct StackFrameFormat { |
| 203 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 204 |
pub parameters: Option<bool>, |
| 205 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 206 |
pub parameter_types: Option<bool>, |
| 207 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 208 |
pub parameter_names: Option<bool>, |
| 209 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 210 |
pub parameter_values: Option<bool>, |
| 211 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 212 |
pub line: Option<bool>, |
| 213 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 214 |
pub module: Option<bool>, |
| 215 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 216 |
pub include_all: Option<bool>, |
| 217 |
} |
| 218 |
|
| 219 |
#[derive(Debug, PartialEq, Eq, Clone, Deserialize, Serialize)] |
| 220 |
#[serde(rename_all = "camelCase")] |
| 221 |
pub struct StackFrame { |
| 222 |
pub id: usize, |
| 223 |
pub name: String, |
| 224 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 225 |
pub source: Option<Source>, |
| 226 |
pub line: usize, |
| 227 |
pub column: usize, |
| 228 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 229 |
pub end_line: Option<usize>, |
| 230 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 231 |
pub end_column: Option<usize>, |
| 232 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 233 |
pub can_restart: Option<bool>, |
| 234 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 235 |
pub instruction_pointer_reference: Option<String>, |
| 236 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 237 |
pub module_id: Option<Value>, |
| 238 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 239 |
pub presentation_hint: Option<String>, |
| 240 |
} |
| 241 |
|
| 242 |
#[derive(Debug, PartialEq, Eq, Clone, Deserialize, Serialize)] |
| 243 |
#[serde(rename_all = "camelCase")] |
| 244 |
pub struct Thread { |
| 245 |
pub id: ThreadId, |
| 246 |
pub name: String, |
| 247 |
} |
| 248 |
|
| 249 |
#[derive(Debug, PartialEq, Eq, Clone, Deserialize, Serialize)] |
| 250 |
#[serde(rename_all = "camelCase")] |
| 251 |
pub struct Scope { |
| 252 |
pub name: String, |
| 253 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 254 |
pub presentation_hint: Option<String>, |
| 255 |
pub variables_reference: usize, |
| 256 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 257 |
pub named_variables: Option<usize>, |
| 258 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 259 |
pub indexed_variables: Option<usize>, |
| 260 |
pub expensive: bool, |
| 261 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 262 |
pub source: Option<Source>, |
| 263 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 264 |
pub line: Option<usize>, |
| 265 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 266 |
pub column: Option<usize>, |
| 267 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 268 |
pub end_line: Option<usize>, |
| 269 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 270 |
pub end_column: Option<usize>, |
| 271 |
} |
| 272 |
|
| 273 |
#[derive(Debug, PartialEq, Eq, Clone, Deserialize, Serialize)] |
| 274 |
#[serde(rename_all = "camelCase")] |
| 275 |
pub struct ValueFormat { |
| 276 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 277 |
pub hex: Option<bool>, |
| 278 |
} |
| 279 |
|
| 280 |
#[derive(Debug, PartialEq, Eq, Clone, Deserialize, Serialize)] |
| 281 |
#[serde(rename_all = "camelCase")] |
| 282 |
pub struct VariablePresentationHint { |
| 283 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 284 |
pub kind: Option<String>, |
| 285 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 286 |
pub attributes: Option<Vec<String>>, |
| 287 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 288 |
pub visibility: Option<String>, |
| 289 |
} |
| 290 |
|
| 291 |
#[derive(Debug, PartialEq, Eq, Clone, Deserialize, Serialize)] |
| 292 |
#[serde(rename_all = "camelCase")] |
| 293 |
pub struct Variable { |
| 294 |
pub name: String, |
| 295 |
pub value: String, |
| 296 |
#[serde(rename = "type", skip_serializing_if = "Option::is_none")] |
| 297 |
pub ty: Option<String>, |
| 298 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 299 |
pub presentation_hint: Option<VariablePresentationHint>, |
| 300 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 301 |
pub evaluate_name: Option<String>, |
| 302 |
pub variables_reference: usize, |
| 303 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 304 |
pub named_variables: Option<usize>, |
| 305 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 306 |
pub indexed_variables: Option<usize>, |
| 307 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 308 |
pub memory_reference: Option<String>, |
| 309 |
} |
| 310 |
|
| 311 |
#[derive(Debug, PartialEq, Eq, Clone, Deserialize, Serialize)] |
| 312 |
#[serde(rename_all = "camelCase")] |
| 313 |
pub struct Module { |
| 314 |
#[serde(deserialize_with = "from_number")] |
| 315 |
pub id: String, |
| 316 |
pub name: String, |
| 317 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 318 |
pub path: Option<PathBuf>, |
| 319 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 320 |
pub is_optimized: Option<bool>, |
| 321 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 322 |
pub is_user_code: Option<bool>, |
| 323 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 324 |
pub version: Option<String>, |
| 325 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 326 |
pub symbol_status: Option<String>, |
| 327 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 328 |
pub symbol_file_path: Option<String>, |
| 329 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 330 |
pub date_time_stamp: Option<String>, |
| 331 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 332 |
pub address_range: Option<String>, |
| 333 |
} |
| 334 |
|
| 335 |
fn from_number<'de, D>(deserializer: D) -> Result<String, D::Error> |
| 336 |
where |
| 337 |
D: Deserializer<'de>, |
| 338 |
{ |
| 339 |
#[derive(Deserialize)] |
| 340 |
#[serde(untagged)] |
| 341 |
enum NumberOrString { |
| 342 |
Number(i64), |
| 343 |
String(String), |
| 344 |
} |
| 345 |
|
| 346 |
match NumberOrString::deserialize(deserializer)? { |
| 347 |
NumberOrString::Number(n) => Ok(n.to_string()), |
| 348 |
NumberOrString::String(s) => Ok(s), |
| 349 |
} |
| 350 |
} |
| 351 |
|
| 352 |
pub mod requests { |
| 353 |
use super::*; |
| 354 |
#[derive(Debug, Default, PartialEq, Eq, Clone, Deserialize, Serialize)] |
| 355 |
#[serde(rename_all = "camelCase")] |
| 356 |
pub struct InitializeArguments { |
| 357 |
#[serde(rename = "clientID", skip_serializing_if = "Option::is_none")] |
| 358 |
pub client_id: Option<String>, |
| 359 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 360 |
pub client_name: Option<String>, |
| 361 |
#[serde(rename = "adapterID")] |
| 362 |
pub adapter_id: String, |
| 363 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 364 |
pub locale: Option<String>, |
| 365 |
#[serde(rename = "linesStartAt1", skip_serializing_if = "Option::is_none")] |
| 366 |
pub lines_start_at_one: Option<bool>, |
| 367 |
#[serde(rename = "columnsStartAt1", skip_serializing_if = "Option::is_none")] |
| 368 |
pub columns_start_at_one: Option<bool>, |
| 369 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 370 |
pub path_format: Option<String>, |
| 371 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 372 |
pub supports_variable_type: Option<bool>, |
| 373 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 374 |
pub supports_variable_paging: Option<bool>, |
| 375 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 376 |
pub supports_run_in_terminal_request: Option<bool>, |
| 377 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 378 |
pub supports_memory_references: Option<bool>, |
| 379 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 380 |
pub supports_progress_reporting: Option<bool>, |
| 381 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 382 |
pub supports_invalidated_event: Option<bool>, |
| 383 |
} |
| 384 |
|
| 385 |
#[derive(Debug)] |
| 386 |
pub enum Initialize {} |
| 387 |
|
| 388 |
impl Request for Initialize { |
| 389 |
type Arguments = InitializeArguments; |
| 390 |
type Result = DebuggerCapabilities; |
| 391 |
const COMMAND: &'static str = "initialize"; |
| 392 |
} |
| 393 |
|
| 394 |
#[derive(Debug)] |
| 395 |
pub enum Launch {} |
| 396 |
|
| 397 |
impl Request for Launch { |
| 398 |
type Arguments = Value; |
| 399 |
type Result = (); |
| 400 |
const COMMAND: &'static str = "launch"; |
| 401 |
} |
| 402 |
|
| 403 |
#[derive(Debug)] |
| 404 |
pub enum Attach {} |
| 405 |
|
| 406 |
impl Request for Attach { |
| 407 |
type Arguments = Value; |
| 408 |
type Result = (); |
| 409 |
const COMMAND: &'static str = "attach"; |
| 410 |
} |
| 411 |
|
| 412 |
#[derive(Debug, Default, PartialEq, Eq, Clone, Deserialize, Serialize)] |
| 413 |
#[serde(rename_all = "camelCase")] |
| 414 |
pub struct DisconnectArguments { |
| 415 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 416 |
pub restart: Option<bool>, |
| 417 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 418 |
pub terminate_debuggee: Option<bool>, |
| 419 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 420 |
pub suspend_debuggee: Option<bool>, |
| 421 |
} |
| 422 |
|
| 423 |
#[derive(Debug)] |
| 424 |
pub enum Restart {} |
| 425 |
|
| 426 |
impl Request for Restart { |
| 427 |
type Arguments = Value; |
| 428 |
type Result = (); |
| 429 |
const COMMAND: &'static str = "restart"; |
| 430 |
} |
| 431 |
|
| 432 |
#[derive(Debug)] |
| 433 |
pub enum Disconnect {} |
| 434 |
|
| 435 |
impl Request for Disconnect { |
| 436 |
type Arguments = Option<DisconnectArguments>; |
| 437 |
type Result = (); |
| 438 |
const COMMAND: &'static str = "disconnect"; |
| 439 |
} |
| 440 |
|
| 441 |
#[derive(Debug, Default, PartialEq, Eq, Clone, Deserialize, Serialize)] |
| 442 |
#[serde(rename_all = "camelCase")] |
| 443 |
pub struct TerminateArguments { |
| 444 |
pub restart: Option<bool>, |
| 445 |
} |
| 446 |
|
| 447 |
#[derive(Debug)] |
| 448 |
pub enum Terminate {} |
| 449 |
|
| 450 |
impl Request for Terminate { |
| 451 |
type Arguments = Option<TerminateArguments>; |
| 452 |
type Result = (); |
| 453 |
const COMMAND: &'static str = "terminate"; |
| 454 |
} |
| 455 |
|
| 456 |
#[derive(Debug)] |
| 457 |
pub enum ConfigurationDone {} |
| 458 |
|
| 459 |
impl Request for ConfigurationDone { |
| 460 |
type Arguments = Option<ConfigurationDoneArguments>; |
| 461 |
type Result = (); |
| 462 |
const COMMAND: &'static str = "configurationDone"; |
| 463 |
} |
| 464 |
|
| 465 |
#[derive(Debug, Default, PartialEq, Eq, Clone, Deserialize, Serialize)] |
| 466 |
pub struct ConfigurationDoneArguments {} |
| 467 |
|
| 468 |
#[derive(Debug, Default, PartialEq, Eq, Clone, Deserialize, Serialize)] |
| 469 |
#[serde(rename_all = "camelCase")] |
| 470 |
pub struct SetBreakpointsArguments { |
| 471 |
pub source: Source, |
| 472 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 473 |
pub breakpoints: Option<Vec<SourceBreakpoint>>, |
| 474 |
|
| 475 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 476 |
pub source_modified: Option<bool>, |
| 477 |
} |
| 478 |
|
| 479 |
#[derive(Debug, Default, PartialEq, Eq, Clone, Deserialize, Serialize)] |
| 480 |
#[serde(rename_all = "camelCase")] |
| 481 |
pub struct SetBreakpointsResponse { |
| 482 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 483 |
pub breakpoints: Option<Vec<Breakpoint>>, |
| 484 |
} |
| 485 |
|
| 486 |
#[derive(Debug)] |
| 487 |
pub enum SetBreakpoints {} |
| 488 |
|
| 489 |
impl Request for SetBreakpoints { |
| 490 |
type Arguments = SetBreakpointsArguments; |
| 491 |
type Result = SetBreakpointsResponse; |
| 492 |
const COMMAND: &'static str = "setBreakpoints"; |
| 493 |
} |
| 494 |
|
| 495 |
#[derive(Debug, Default, PartialEq, Eq, Clone, Deserialize, Serialize)] |
| 496 |
#[serde(rename_all = "camelCase")] |
| 497 |
pub struct ContinueArguments { |
| 498 |
pub thread_id: ThreadId, |
| 499 |
} |
| 500 |
|
| 501 |
#[derive(Debug, PartialEq, Eq, Clone, Deserialize, Serialize)] |
| 502 |
#[serde(rename_all = "camelCase")] |
| 503 |
pub struct ContinueResponse { |
| 504 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 505 |
pub all_threads_continued: Option<bool>, |
| 506 |
} |
| 507 |
|
| 508 |
#[derive(Debug)] |
| 509 |
pub enum Continue {} |
| 510 |
|
| 511 |
impl Request for Continue { |
| 512 |
type Arguments = ContinueArguments; |
| 513 |
type Result = ContinueResponse; |
| 514 |
const COMMAND: &'static str = "continue"; |
| 515 |
} |
| 516 |
|
| 517 |
#[derive(Debug, Default, PartialEq, Eq, Clone, Deserialize, Serialize)] |
| 518 |
#[serde(rename_all = "camelCase")] |
| 519 |
pub struct StackTraceArguments { |
| 520 |
pub thread_id: ThreadId, |
| 521 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 522 |
pub start_frame: Option<usize>, |
| 523 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 524 |
pub levels: Option<usize>, |
| 525 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 526 |
pub format: Option<StackFrameFormat>, |
| 527 |
} |
| 528 |
|
| 529 |
#[derive(Debug, PartialEq, Eq, Clone, Deserialize, Serialize)] |
| 530 |
#[serde(rename_all = "camelCase")] |
| 531 |
pub struct StackTraceResponse { |
| 532 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 533 |
pub total_frames: Option<usize>, |
| 534 |
pub stack_frames: Vec<StackFrame>, |
| 535 |
} |
| 536 |
|
| 537 |
#[derive(Debug)] |
| 538 |
pub enum StackTrace {} |
| 539 |
|
| 540 |
impl Request for StackTrace { |
| 541 |
type Arguments = StackTraceArguments; |
| 542 |
type Result = StackTraceResponse; |
| 543 |
const COMMAND: &'static str = "stackTrace"; |
| 544 |
} |
| 545 |
|
| 546 |
#[derive(Debug, PartialEq, Eq, Clone, Deserialize, Serialize)] |
| 547 |
pub struct ThreadsArguments {} |
| 548 |
|
| 549 |
#[derive(Debug, PartialEq, Eq, Clone, Deserialize, Serialize)] |
| 550 |
#[serde(rename_all = "camelCase")] |
| 551 |
pub struct ThreadsResponse { |
| 552 |
pub threads: Vec<Thread>, |
| 553 |
} |
| 554 |
|
| 555 |
#[derive(Debug)] |
| 556 |
pub enum Threads {} |
| 557 |
|
| 558 |
impl Request for Threads { |
| 559 |
type Arguments = Option<ThreadsArguments>; |
| 560 |
type Result = ThreadsResponse; |
| 561 |
const COMMAND: &'static str = "threads"; |
| 562 |
} |
| 563 |
|
| 564 |
#[derive(Debug, PartialEq, Eq, Clone, Deserialize, Serialize)] |
| 565 |
#[serde(rename_all = "camelCase")] |
| 566 |
pub struct ScopesArguments { |
| 567 |
pub frame_id: usize, |
| 568 |
} |
| 569 |
|
| 570 |
#[derive(Debug, PartialEq, Eq, Clone, Deserialize, Serialize)] |
| 571 |
#[serde(rename_all = "camelCase")] |
| 572 |
pub struct ScopesResponse { |
| 573 |
pub scopes: Vec<Scope>, |
| 574 |
} |
| 575 |
|
| 576 |
#[derive(Debug)] |
| 577 |
pub enum Scopes {} |
| 578 |
|
| 579 |
impl Request for Scopes { |
| 580 |
type Arguments = ScopesArguments; |
| 581 |
type Result = ScopesResponse; |
| 582 |
const COMMAND: &'static str = "scopes"; |
| 583 |
} |
| 584 |
|
| 585 |
#[derive(Debug, Default, PartialEq, Eq, Clone, Deserialize, Serialize)] |
| 586 |
#[serde(rename_all = "camelCase")] |
| 587 |
pub struct VariablesArguments { |
| 588 |
pub variables_reference: usize, |
| 589 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 590 |
pub filter: Option<String>, |
| 591 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 592 |
pub start: Option<usize>, |
| 593 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 594 |
pub count: Option<usize>, |
| 595 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 596 |
pub format: Option<ValueFormat>, |
| 597 |
} |
| 598 |
|
| 599 |
#[derive(Debug, PartialEq, Eq, Clone, Deserialize, Serialize)] |
| 600 |
#[serde(rename_all = "camelCase")] |
| 601 |
pub struct VariablesResponse { |
| 602 |
pub variables: Vec<Variable>, |
| 603 |
} |
| 604 |
|
| 605 |
#[derive(Debug)] |
| 606 |
pub enum Variables {} |
| 607 |
|
| 608 |
impl Request for Variables { |
| 609 |
type Arguments = VariablesArguments; |
| 610 |
type Result = VariablesResponse; |
| 611 |
const COMMAND: &'static str = "variables"; |
| 612 |
} |
| 613 |
|
| 614 |
#[derive(Debug, PartialEq, Eq, Clone, Deserialize, Serialize)] |
| 615 |
#[serde(rename_all = "camelCase")] |
| 616 |
pub struct StepInArguments { |
| 617 |
pub thread_id: ThreadId, |
| 618 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 619 |
pub target_id: Option<usize>, |
| 620 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 621 |
pub granularity: Option<String>, |
| 622 |
} |
| 623 |
|
| 624 |
#[derive(Debug)] |
| 625 |
pub enum StepIn {} |
| 626 |
|
| 627 |
impl Request for StepIn { |
| 628 |
type Arguments = StepInArguments; |
| 629 |
type Result = (); |
| 630 |
const COMMAND: &'static str = "stepIn"; |
| 631 |
} |
| 632 |
|
| 633 |
#[derive(Debug, PartialEq, Eq, Clone, Deserialize, Serialize)] |
| 634 |
#[serde(rename_all = "camelCase")] |
| 635 |
pub struct StepOutArguments { |
| 636 |
pub thread_id: ThreadId, |
| 637 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 638 |
pub granularity: Option<String>, |
| 639 |
} |
| 640 |
|
| 641 |
#[derive(Debug)] |
| 642 |
pub enum StepOut {} |
| 643 |
|
| 644 |
impl Request for StepOut { |
| 645 |
type Arguments = StepOutArguments; |
| 646 |
type Result = (); |
| 647 |
const COMMAND: &'static str = "stepOut"; |
| 648 |
} |
| 649 |
|
| 650 |
#[derive(Debug, PartialEq, Eq, Clone, Deserialize, Serialize)] |
| 651 |
#[serde(rename_all = "camelCase")] |
| 652 |
pub struct NextArguments { |
| 653 |
pub thread_id: ThreadId, |
| 654 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 655 |
pub granularity: Option<String>, |
| 656 |
} |
| 657 |
|
| 658 |
#[derive(Debug)] |
| 659 |
pub enum Next {} |
| 660 |
|
| 661 |
impl Request for Next { |
| 662 |
type Arguments = NextArguments; |
| 663 |
type Result = (); |
| 664 |
const COMMAND: &'static str = "next"; |
| 665 |
} |
| 666 |
|
| 667 |
#[derive(Debug, PartialEq, Eq, Clone, Deserialize, Serialize)] |
| 668 |
#[serde(rename_all = "camelCase")] |
| 669 |
pub struct PauseArguments { |
| 670 |
pub thread_id: ThreadId, |
| 671 |
} |
| 672 |
|
| 673 |
#[derive(Debug)] |
| 674 |
pub enum Pause {} |
| 675 |
|
| 676 |
impl Request for Pause { |
| 677 |
type Arguments = PauseArguments; |
| 678 |
type Result = (); |
| 679 |
const COMMAND: &'static str = "pause"; |
| 680 |
} |
| 681 |
|
| 682 |
#[derive(Debug, PartialEq, Eq, Clone, Deserialize, Serialize)] |
| 683 |
#[serde(rename_all = "camelCase")] |
| 684 |
pub struct EvaluateArguments { |
| 685 |
pub expression: String, |
| 686 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 687 |
pub frame_id: Option<usize>, |
| 688 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 689 |
pub context: Option<String>, |
| 690 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 691 |
pub format: Option<ValueFormat>, |
| 692 |
} |
| 693 |
|
| 694 |
#[derive(Debug, PartialEq, Eq, Clone, Deserialize, Serialize)] |
| 695 |
#[serde(rename_all = "camelCase")] |
| 696 |
pub struct EvaluateResponse { |
| 697 |
pub result: String, |
| 698 |
#[serde(rename = "type", skip_serializing_if = "Option::is_none")] |
| 699 |
pub ty: Option<String>, |
| 700 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 701 |
pub presentation_hint: Option<VariablePresentationHint>, |
| 702 |
pub variables_reference: usize, |
| 703 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 704 |
pub named_variables: Option<usize>, |
| 705 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 706 |
pub indexed_variables: Option<usize>, |
| 707 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 708 |
pub memory_reference: Option<String>, |
| 709 |
} |
| 710 |
|
| 711 |
#[derive(Debug)] |
| 712 |
pub enum Evaluate {} |
| 713 |
|
| 714 |
impl Request for Evaluate { |
| 715 |
type Arguments = EvaluateArguments; |
| 716 |
type Result = EvaluateResponse; |
| 717 |
const COMMAND: &'static str = "evaluate"; |
| 718 |
} |
| 719 |
|
| 720 |
#[derive(Debug, PartialEq, Eq, Clone, Deserialize, Serialize)] |
| 721 |
#[serde(rename_all = "camelCase")] |
| 722 |
pub struct SetExceptionBreakpointsArguments { |
| 723 |
pub filters: Vec<String>, |
| 724 |
|
| 725 |
|
| 726 |
} |
| 727 |
|
| 728 |
#[derive(Debug, PartialEq, Eq, Clone, Deserialize, Serialize)] |
| 729 |
#[serde(rename_all = "camelCase")] |
| 730 |
pub struct SetExceptionBreakpointsResponse { |
| 731 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 732 |
pub breakpoints: Option<Vec<Breakpoint>>, |
| 733 |
} |
| 734 |
|
| 735 |
#[derive(Debug)] |
| 736 |
pub enum SetExceptionBreakpoints {} |
| 737 |
|
| 738 |
impl Request for SetExceptionBreakpoints { |
| 739 |
type Arguments = SetExceptionBreakpointsArguments; |
| 740 |
type Result = SetExceptionBreakpointsResponse; |
| 741 |
const COMMAND: &'static str = "setExceptionBreakpoints"; |
| 742 |
} |
| 743 |
|
| 744 |
|
| 745 |
|
| 746 |
#[derive(Debug, Default, PartialEq, Eq, Clone, Deserialize, Serialize)] |
| 747 |
#[serde(rename_all = "camelCase")] |
| 748 |
pub struct RunInTerminalResponse { |
| 749 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 750 |
pub process_id: Option<u32>, |
| 751 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 752 |
pub shell_process_id: Option<u32>, |
| 753 |
} |
| 754 |
|
| 755 |
#[derive(Debug, PartialEq, Eq, Clone, Deserialize, Serialize)] |
| 756 |
#[serde(rename_all = "camelCase")] |
| 757 |
pub struct RunInTerminalArguments { |
| 758 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 759 |
pub kind: Option<String>, |
| 760 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 761 |
pub title: Option<String>, |
| 762 |
pub cwd: String, |
| 763 |
pub args: Vec<String>, |
| 764 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 765 |
pub env: Option<HashMap<String, Option<String>>>, |
| 766 |
} |
| 767 |
|
| 768 |
#[derive(Debug)] |
| 769 |
pub enum RunInTerminal {} |
| 770 |
|
| 771 |
impl Request for RunInTerminal { |
| 772 |
type Arguments = RunInTerminalArguments; |
| 773 |
type Result = RunInTerminalResponse; |
| 774 |
const COMMAND: &'static str = "runInTerminal"; |
| 775 |
} |
| 776 |
#[derive(Debug, PartialEq, Eq, Clone, Deserialize, Serialize)] |
| 777 |
#[serde(rename_all = "camelCase")] |
| 778 |
pub struct StartDebuggingArguments { |
| 779 |
pub request: ConnectionType, |
| 780 |
pub configuration: Value, |
| 781 |
} |
| 782 |
|
| 783 |
#[derive(Debug)] |
| 784 |
pub enum StartDebugging {} |
| 785 |
|
| 786 |
impl Request for StartDebugging { |
| 787 |
type Arguments = StartDebuggingArguments; |
| 788 |
type Result = (); |
| 789 |
const COMMAND: &'static str = "startDebugging"; |
| 790 |
} |
| 791 |
} |
| 792 |
|
| 793 |
|
| 794 |
|
| 795 |
pub mod events { |
| 796 |
use super::*; |
| 797 |
|
| 798 |
pub trait Event { |
| 799 |
type Body: serde::de::DeserializeOwned + serde::Serialize; |
| 800 |
const EVENT: &'static str; |
| 801 |
} |
| 802 |
|
| 803 |
#[derive(Debug)] |
| 804 |
pub enum Initialized {} |
| 805 |
|
| 806 |
impl Event for Initialized { |
| 807 |
type Body = Option<DebuggerCapabilities>; |
| 808 |
const EVENT: &'static str = "initialized"; |
| 809 |
} |
| 810 |
|
| 811 |
#[derive(Debug)] |
| 812 |
pub enum Stopped {} |
| 813 |
|
| 814 |
impl Event for Stopped { |
| 815 |
type Body = StoppedBody; |
| 816 |
const EVENT: &'static str = "stopped"; |
| 817 |
} |
| 818 |
|
| 819 |
#[derive(Debug, PartialEq, Eq, Clone, Deserialize, Serialize)] |
| 820 |
#[serde(rename_all = "camelCase")] |
| 821 |
pub struct StoppedBody { |
| 822 |
pub reason: String, |
| 823 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 824 |
pub description: Option<String>, |
| 825 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 826 |
pub thread_id: Option<ThreadId>, |
| 827 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 828 |
pub preserve_focus_hint: Option<bool>, |
| 829 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 830 |
pub text: Option<String>, |
| 831 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 832 |
pub all_threads_stopped: Option<bool>, |
| 833 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 834 |
pub hit_breakpoint_ids: Option<Vec<i32>>, |
| 835 |
} |
| 836 |
|
| 837 |
#[derive(Debug)] |
| 838 |
pub enum Continued {} |
| 839 |
|
| 840 |
impl Event for Continued { |
| 841 |
type Body = ContinuedBody; |
| 842 |
const EVENT: &'static str = "continued"; |
| 843 |
} |
| 844 |
|
| 845 |
#[derive(Debug, PartialEq, Eq, Clone, Deserialize, Serialize)] |
| 846 |
#[serde(rename_all = "camelCase")] |
| 847 |
pub struct ContinuedBody { |
| 848 |
pub thread_id: ThreadId, |
| 849 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 850 |
pub all_threads_continued: Option<bool>, |
| 851 |
} |
| 852 |
|
| 853 |
#[derive(Debug)] |
| 854 |
pub enum Exited {} |
| 855 |
|
| 856 |
impl Event for Exited { |
| 857 |
type Body = ExitedBody; |
| 858 |
const EVENT: &'static str = "exited"; |
| 859 |
} |
| 860 |
|
| 861 |
#[derive(Debug, PartialEq, Eq, Clone, Deserialize, Serialize)] |
| 862 |
#[serde(rename_all = "camelCase")] |
| 863 |
pub struct ExitedBody { |
| 864 |
pub exit_code: usize, |
| 865 |
} |
| 866 |
|
| 867 |
#[derive(Debug)] |
| 868 |
pub enum Terminated {} |
| 869 |
|
| 870 |
impl Event for Terminated { |
| 871 |
type Body = Option<TerminatedBody>; |
| 872 |
const EVENT: &'static str = "terminated"; |
| 873 |
} |
| 874 |
|
| 875 |
#[derive(Debug, PartialEq, Eq, Clone, Deserialize, Serialize)] |
| 876 |
#[serde(rename_all = "camelCase")] |
| 877 |
pub struct TerminatedBody { |
| 878 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 879 |
pub restart: Option<Value>, |
| 880 |
} |
| 881 |
|
| 882 |
#[derive(Debug)] |
| 883 |
pub enum Thread {} |
| 884 |
|
| 885 |
impl Event for Thread { |
| 886 |
type Body = ThreadBody; |
| 887 |
const EVENT: &'static str = "thread"; |
| 888 |
} |
| 889 |
|
| 890 |
#[derive(Debug, PartialEq, Eq, Clone, Deserialize, Serialize)] |
| 891 |
#[serde(rename_all = "camelCase")] |
| 892 |
pub struct ThreadBody { |
| 893 |
pub reason: String, |
| 894 |
pub thread_id: ThreadId, |
| 895 |
} |
| 896 |
|
| 897 |
#[derive(Debug)] |
| 898 |
pub enum Output {} |
| 899 |
|
| 900 |
impl Event for Output { |
| 901 |
type Body = OutputBody; |
| 902 |
const EVENT: &'static str = "output"; |
| 903 |
} |
| 904 |
|
| 905 |
#[derive(Debug, PartialEq, Eq, Clone, Deserialize, Serialize)] |
| 906 |
#[serde(rename_all = "camelCase")] |
| 907 |
pub struct OutputBody { |
| 908 |
pub output: String, |
| 909 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 910 |
pub category: Option<String>, |
| 911 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 912 |
pub group: Option<String>, |
| 913 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 914 |
pub line: Option<usize>, |
| 915 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 916 |
pub column: Option<usize>, |
| 917 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 918 |
pub variables_reference: Option<usize>, |
| 919 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 920 |
pub source: Option<Source>, |
| 921 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 922 |
pub data: Option<Value>, |
| 923 |
} |
| 924 |
|
| 925 |
#[derive(Debug)] |
| 926 |
pub enum ProgressStart {} |
| 927 |
|
| 928 |
impl Event for ProgressStart { |
| 929 |
type Body = ProgressStartBody; |
| 930 |
const EVENT: &'static str = "progressStart"; |
| 931 |
} |
| 932 |
|
| 933 |
#[derive(Debug, PartialEq, Eq, Clone, Deserialize, Serialize)] |
| 934 |
#[serde(rename_all = "camelCase")] |
| 935 |
pub struct ProgressStartBody { |
| 936 |
pub progress_id: String, |
| 937 |
pub title: String, |
| 938 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 939 |
pub request_id: Option<u64>, |
| 940 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 941 |
pub cancellable: Option<bool>, |
| 942 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 943 |
pub message: Option<String>, |
| 944 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 945 |
pub percentage: Option<u8>, |
| 946 |
} |
| 947 |
|
| 948 |
#[derive(Debug)] |
| 949 |
pub enum ProgressUpdate {} |
| 950 |
|
| 951 |
impl Event for ProgressUpdate { |
| 952 |
type Body = ProgressUpdateBody; |
| 953 |
const EVENT: &'static str = "progressUpdate"; |
| 954 |
} |
| 955 |
|
| 956 |
#[derive(Debug, PartialEq, Eq, Clone, Deserialize, Serialize)] |
| 957 |
#[serde(rename_all = "camelCase")] |
| 958 |
pub struct ProgressUpdateBody { |
| 959 |
pub progress_id: String, |
| 960 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 961 |
pub message: Option<String>, |
| 962 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 963 |
pub percentage: Option<u8>, |
| 964 |
} |
| 965 |
|
| 966 |
#[derive(Debug)] |
| 967 |
pub enum ProgressEnd {} |
| 968 |
|
| 969 |
impl Event for ProgressEnd { |
| 970 |
type Body = ProgressEndBody; |
| 971 |
const EVENT: &'static str = "progressEnd"; |
| 972 |
} |
| 973 |
|
| 974 |
#[derive(Debug, PartialEq, Eq, Clone, Deserialize, Serialize)] |
| 975 |
#[serde(rename_all = "camelCase")] |
| 976 |
pub struct ProgressEndBody { |
| 977 |
pub progress_id: String, |
| 978 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 979 |
pub message: Option<String>, |
| 980 |
} |
| 981 |
|
| 982 |
#[derive(Debug)] |
| 983 |
pub enum Breakpoint {} |
| 984 |
|
| 985 |
impl Event for Breakpoint { |
| 986 |
type Body = BreakpointBody; |
| 987 |
const EVENT: &'static str = "breakpoint"; |
| 988 |
} |
| 989 |
|
| 990 |
#[derive(Debug, PartialEq, Eq, Clone, Deserialize, Serialize)] |
| 991 |
#[serde(rename_all = "camelCase")] |
| 992 |
pub struct BreakpointBody { |
| 993 |
pub reason: String, |
| 994 |
pub breakpoint: super::Breakpoint, |
| 995 |
} |
| 996 |
|
| 997 |
#[derive(Debug)] |
| 998 |
pub enum Module {} |
| 999 |
|
| 1000 |
impl Event for Module { |
| 1001 |
type Body = ModuleBody; |
| 1002 |
const EVENT: &'static str = "module"; |
| 1003 |
} |
| 1004 |
|
| 1005 |
#[derive(Debug, PartialEq, Eq, Clone, Deserialize, Serialize)] |
| 1006 |
#[serde(rename_all = "camelCase")] |
| 1007 |
pub struct ModuleBody { |
| 1008 |
pub reason: String, |
| 1009 |
pub module: super::Module, |
| 1010 |
} |
| 1011 |
|
| 1012 |
#[derive(Debug)] |
| 1013 |
pub enum LoadedSource {} |
| 1014 |
|
| 1015 |
impl Event for LoadedSource { |
| 1016 |
type Body = LoadedSourceBody; |
| 1017 |
const EVENT: &'static str = "loadedSource"; |
| 1018 |
} |
| 1019 |
|
| 1020 |
#[derive(Debug, PartialEq, Eq, Clone, Deserialize, Serialize)] |
| 1021 |
#[serde(rename_all = "camelCase")] |
| 1022 |
pub struct LoadedSourceBody { |
| 1023 |
pub reason: String, |
| 1024 |
pub source: super::Source, |
| 1025 |
} |
| 1026 |
|
| 1027 |
#[derive(Debug)] |
| 1028 |
pub enum Process {} |
| 1029 |
|
| 1030 |
impl Event for Process { |
| 1031 |
type Body = ProcessBody; |
| 1032 |
const EVENT: &'static str = "process"; |
| 1033 |
} |
| 1034 |
|
| 1035 |
#[derive(Debug, PartialEq, Eq, Clone, Deserialize, Serialize)] |
| 1036 |
#[serde(rename_all = "camelCase")] |
| 1037 |
pub struct ProcessBody { |
| 1038 |
pub name: String, |
| 1039 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 1040 |
pub system_process_id: Option<usize>, |
| 1041 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 1042 |
pub is_local_process: Option<bool>, |
| 1043 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 1044 |
pub start_method: Option<String>, |
| 1045 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 1046 |
pub pointer_size: Option<usize>, |
| 1047 |
} |
| 1048 |
|
| 1049 |
#[derive(Debug)] |
| 1050 |
pub enum Capabilities {} |
| 1051 |
|
| 1052 |
impl Event for Capabilities { |
| 1053 |
type Body = CapabilitiesBody; |
| 1054 |
const EVENT: &'static str = "capabilities"; |
| 1055 |
} |
| 1056 |
|
| 1057 |
#[derive(Debug, PartialEq, Eq, Clone, Deserialize, Serialize)] |
| 1058 |
#[serde(rename_all = "camelCase")] |
| 1059 |
pub struct CapabilitiesBody { |
| 1060 |
pub capabilities: super::DebuggerCapabilities, |
| 1061 |
} |
| 1062 |
|
| 1063 |
|
| 1064 |
|
| 1065 |
|
| 1066 |
|
| 1067 |
|
| 1068 |
|
| 1069 |
|
| 1070 |
|
| 1071 |
#[derive(Debug)] |
| 1072 |
pub enum Memory {} |
| 1073 |
|
| 1074 |
impl Event for Memory { |
| 1075 |
type Body = MemoryBody; |
| 1076 |
const EVENT: &'static str = "memory"; |
| 1077 |
} |
| 1078 |
|
| 1079 |
#[derive(Debug, PartialEq, Eq, Clone, Deserialize, Serialize)] |
| 1080 |
#[serde(rename_all = "camelCase")] |
| 1081 |
pub struct MemoryBody { |
| 1082 |
pub memory_reference: String, |
| 1083 |
pub offset: usize, |
| 1084 |
pub count: usize, |
| 1085 |
} |
| 1086 |
} |
| 1087 |
|
| 1088 |
#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)] |
| 1089 |
#[serde(rename_all = "lowercase")] |
| 1090 |
pub enum ConnectionType { |
| 1091 |
Launch, |
| 1092 |
Attach, |
| 1093 |
} |
| 1094 |
|
| 1095 |
#[test] |
| 1096 |
fn test_deserialize_module_id_from_number() { |
| 1097 |
let raw = r#"{"id": 0, "name": "Name"}"#; |
| 1098 |
let module: Module = serde_json::from_str(raw).expect("Error!"); |
| 1099 |
assert_eq!(module.id, "0"); |
| 1100 |
} |
| 1101 |
|
| 1102 |
#[test] |
| 1103 |
fn test_deserialize_module_id_from_string() { |
| 1104 |
let raw = r#"{"id": "0", "name": "Name"}"#; |
| 1105 |
let module: Module = serde_json::from_str(raw).expect("Error!"); |
| 1106 |
assert_eq!(module.id, "0"); |
| 1107 |
} |