@@ -139,7 +139,9 @@ pub struct Stacktrace {
139
139
/// Represents a thread id.
140
140
#[ derive( Serialize , Deserialize , Debug , Clone , PartialEq , Eq , Ord , PartialOrd , Hash ) ]
141
141
pub enum ThreadId {
142
+ /// Integer representation for the thread id
142
143
Int ( i64 ) ,
144
+ /// String representation for the thread id
143
145
String ( String ) ,
144
146
}
145
147
@@ -162,10 +164,17 @@ impl fmt::Display for ThreadId {
162
164
#[ derive( Serialize , Deserialize , Debug , Default , Clone , PartialEq ) ]
163
165
#[ serde( default ) ]
164
166
pub struct Thread {
167
+ /// The optional ID of the thread (usually an integer)
165
168
pub id : Option < ThreadId > ,
169
+ /// The optional name of the thread.
166
170
pub name : Option < String > ,
171
+ /// If the thread suspended or crashed a stacktrace can be
172
+ /// attached here.
167
173
pub stacktrace : Option < Stacktrace > ,
174
+ /// indicates a crashed thread
168
175
pub crashed : bool ,
176
+ /// indicates that the thread was not suspended when the
177
+ /// event was created.
169
178
pub current : bool ,
170
179
}
171
180
@@ -236,12 +245,25 @@ impl Level {
236
245
#[ derive( Serialize , Deserialize , Debug , Clone , PartialEq ) ]
237
246
#[ serde( default ) ]
238
247
pub struct Breadcrumb {
239
- #[ serde( with = "chrono::serde::ts_seconds" ) ] pub timestamp : DateTime < Utc > ,
240
- #[ serde( rename = "type" ) ] pub ty : String ,
241
- #[ serde( skip_serializing_if = "Option::is_none" ) ] pub category : Option < String > ,
242
- #[ serde( skip_serializing_if = "Level::is_info" ) ] pub level : Level ,
243
- #[ serde( skip_serializing_if = "Option::is_none" ) ] pub message : Option < String > ,
244
- #[ serde( skip_serializing_if = "HashMap::is_empty" ) ] pub data : HashMap < String , Value > ,
248
+ /// The timestamp of the breadcrumb. This is required.
249
+ #[ serde( with = "chrono::serde::ts_seconds" ) ]
250
+ pub timestamp : DateTime < Utc > ,
251
+ /// The type of the breadcrumb.
252
+ #[ serde( rename = "type" ) ]
253
+ pub ty : String ,
254
+ /// The optional category of the breadcrumb.
255
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
256
+ pub category : Option < String > ,
257
+ /// The non optional level of the breadcrumb. It
258
+ /// defaults to info.
259
+ #[ serde( skip_serializing_if = "Level::is_info" ) ]
260
+ pub level : Level ,
261
+ /// An optional human readbale message for the breadcrumb.
262
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
263
+ pub message : Option < String > ,
264
+ /// Arbitrary breadcrumb data that should be send along.
265
+ #[ serde( skip_serializing_if = "HashMap::is_empty" ) ]
266
+ pub data : HashMap < String , Value > ,
245
267
}
246
268
247
269
impl Default for Breadcrumb {
@@ -261,26 +283,44 @@ impl Default for Breadcrumb {
261
283
#[ derive( Serialize , Deserialize , Debug , Default , Clone , PartialEq ) ]
262
284
#[ serde( default ) ]
263
285
pub struct User {
286
+ /// The ID of the user.
264
287
pub id : Option < String > ,
288
+ /// The email address of the user.
265
289
pub email : Option < String > ,
290
+ /// The remote ip address of the user.
266
291
pub ip_address : Option < IpAddr > ,
292
+ /// A human readable username of the user.
267
293
pub username : Option < String > ,
268
- #[ serde( flatten) ] pub data : HashMap < String , Value > ,
294
+ /// Additional data that should be send along.
295
+ #[ serde( flatten) ]
296
+ pub data : HashMap < String , Value > ,
269
297
}
270
298
271
299
/// Represents http request data.
272
300
#[ derive( Serialize , Deserialize , Debug , Default , Clone , PartialEq ) ]
273
301
#[ serde( default ) ]
274
302
pub struct Request {
275
- #[ serde( with = "url_serde" ) ] pub url : Option < Url > ,
303
+ /// The current URL of the request.
304
+ #[ serde( with = "url_serde" ) ]
305
+ pub url : Option < Url > ,
306
+ /// The HTTP request method.
276
307
pub method : Option < String > ,
308
+ /// Optionally some associated request data (human readable)
277
309
// XXX: this makes absolutely no sense because of unicode
278
310
pub data : Option < String > ,
311
+ /// Optionally the encoded query string.
279
312
pub query_string : Option < String > ,
313
+ /// An encoded cookie string if available.
280
314
pub cookies : Option < String > ,
281
- #[ serde( skip_serializing_if = "HashMap::is_empty" ) ] pub headers : HashMap < String , String > ,
282
- #[ serde( skip_serializing_if = "HashMap::is_empty" ) ] pub env : HashMap < String , String > ,
283
- #[ serde( flatten) ] pub other : HashMap < String , Value > ,
315
+ /// HTTP request headers.
316
+ #[ serde( skip_serializing_if = "HashMap::is_empty" ) ]
317
+ pub headers : HashMap < String , String > ,
318
+ /// Optionally a CGI/WSGI etc. environment dictionary.
319
+ #[ serde( skip_serializing_if = "HashMap::is_empty" ) ]
320
+ pub env : HashMap < String , String > ,
321
+ /// Additional unhandled keys.
322
+ #[ serde( flatten) ]
323
+ pub other : HashMap < String , Value > ,
284
324
}
285
325
286
326
/// Holds information about the system SDK.
@@ -302,8 +342,12 @@ pub struct SystemSdkInfo {
302
342
/// Represents a debug image.
303
343
#[ derive( Debug , Clone , PartialEq ) ]
304
344
pub enum DebugImage {
345
+ /// Apple debug images (machos). This is currently also used for
346
+ /// non apple platforms with similar debug setups.
305
347
Apple ( AppleDebugImage ) ,
348
+ /// A reference to a proguard debug file.
306
349
Proguard ( ProguardDebugImage ) ,
350
+ /// A debug image that is unknown to this protocol specification.
307
351
Unknown ( HashMap < String , Value > ) ,
308
352
}
309
353
@@ -323,19 +367,28 @@ impl DebugImage {
323
367
/// Represents an apple debug image in the debug meta.
324
368
#[ derive( Serialize , Deserialize , Debug , Clone , PartialEq ) ]
325
369
pub struct AppleDebugImage {
370
+ /// The name of the debug image (usually filename)
326
371
pub name : String ,
372
+ /// The optional CPU architecture of the debug image.
327
373
pub arch : Option < String > ,
328
- pub cpu_type : u32 ,
329
- pub cpu_subtype : u32 ,
374
+ /// Alternatively a macho cpu type.
375
+ pub cpu_type : Option < u32 > ,
376
+ /// Alternatively a macho cpu subtype.
377
+ pub cpu_subtype : Option < u32 > ,
378
+ /// The starting address of the image.
330
379
pub image_addr : u64 ,
380
+ /// The size of the image in bytes.
331
381
pub image_size : u64 ,
382
+ /// The address where the image is loaded at runtime.
332
383
pub image_vmaddr : u64 ,
384
+ /// The unique UUID of the image.
333
385
pub uuid : Uuid ,
334
386
}
335
387
336
388
/// Represents a proguard mapping file reference.
337
389
#[ derive( Serialize , Deserialize , Debug , Clone , PartialEq ) ]
338
390
pub struct ProguardDebugImage {
391
+ /// The UUID of the associated proguard file.
339
392
pub uuid : Uuid ,
340
393
}
341
394
@@ -372,7 +425,7 @@ pub struct ClientSdkInfo {
372
425
pub version : String ,
373
426
/// An optional list of integrations that are enabled in this SDK.
374
427
#[ serde( skip_serializing_if = "Vec::is_empty" ) ]
375
- pub integrations : Vec < String >
428
+ pub integrations : Vec < String > ,
376
429
}
377
430
378
431
/// Represents a full event for Sentry.
@@ -434,9 +487,10 @@ pub struct Event {
434
487
#[ serde( skip_serializing_if = "HashMap::is_empty" , serialize_with = "serialize_context" ,
435
488
deserialize_with = "deserialize_context" ) ]
436
489
pub contexts : HashMap < String , Context > ,
437
- /// Exceptions to be attached (one or multiple if chained) .
490
+ /// List of breadcrumbs to send along .
438
491
#[ serde( skip_serializing_if = "Vec::is_empty" ) ]
439
492
pub breadcrumbs : Vec < Breadcrumb > ,
493
+ /// Exceptions to be attached (one or multiple if chained).
440
494
#[ serde( skip_serializing_if = "Vec::is_empty" , serialize_with = "serialize_exceptions" ,
441
495
deserialize_with = "deserialize_exceptions" , rename = "exception" ) ]
442
496
pub exceptions : Vec < Exception > ,
@@ -559,30 +613,58 @@ pub enum ContextType {
559
613
/// Holds device information.
560
614
#[ derive( Serialize , Deserialize , Debug , Clone , Default , PartialEq ) ]
561
615
pub struct DeviceContext {
562
- #[ serde( skip_serializing_if = "Option::is_none" ) ] pub name : Option < String > ,
563
- #[ serde( skip_serializing_if = "Option::is_none" ) ] pub family : Option < String > ,
564
- #[ serde( skip_serializing_if = "Option::is_none" ) ] pub model : Option < String > ,
565
- #[ serde( skip_serializing_if = "Option::is_none" ) ] pub model_id : Option < String > ,
566
- #[ serde( skip_serializing_if = "Option::is_none" ) ] pub arch : Option < String > ,
567
- #[ serde( skip_serializing_if = "Option::is_none" ) ] pub battery_level : Option < f32 > ,
568
- #[ serde( skip_serializing_if = "Option::is_none" ) ] pub orientation : Option < Orientation > ,
616
+ /// The name of the device.
617
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
618
+ pub name : Option < String > ,
619
+ /// The family of the device model.
620
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
621
+ pub family : Option < String > ,
622
+ /// The device model (human readable)
623
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
624
+ pub model : Option < String > ,
625
+ /// The device model (internal identifier)
626
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
627
+ pub model_id : Option < String > ,
628
+ /// The native cpu architecture of the device.
629
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
630
+ pub arch : Option < String > ,
631
+ /// The current battery level (0-100)
632
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
633
+ pub battery_level : Option < f32 > ,
634
+ /// The current screen orientation.
635
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
636
+ pub orientation : Option < Orientation > ,
569
637
}
570
638
571
639
/// Holds operating system information.
572
640
#[ derive( Serialize , Deserialize , Debug , Clone , Default , PartialEq ) ]
573
641
pub struct OsContext {
574
- #[ serde( skip_serializing_if = "Option::is_none" ) ] pub name : Option < String > ,
575
- #[ serde( skip_serializing_if = "Option::is_none" ) ] pub version : Option < String > ,
576
- #[ serde( skip_serializing_if = "Option::is_none" ) ] pub build : Option < String > ,
577
- #[ serde( skip_serializing_if = "Option::is_none" ) ] pub kernel_version : Option < String > ,
578
- #[ serde( skip_serializing_if = "Option::is_none" ) ] pub rooted : Option < bool > ,
642
+ /// The name of the operating system.
643
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
644
+ pub name : Option < String > ,
645
+ /// The version of the operating system.
646
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
647
+ pub version : Option < String > ,
648
+ /// The internal build number of the operating system.
649
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
650
+ pub build : Option < String > ,
651
+ /// The current kernel version
652
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
653
+ pub kernel_version : Option < String > ,
654
+ /// An indicator if the os is rooted (mobile mostly)
655
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
656
+ pub rooted : Option < bool > ,
579
657
}
580
658
581
659
/// Holds information about the runtime.
582
660
#[ derive( Serialize , Deserialize , Debug , Clone , Default , PartialEq ) ]
583
661
pub struct RuntimeContext {
584
- #[ serde( skip_serializing_if = "Option::is_none" ) ] pub name : Option < String > ,
585
- #[ serde( skip_serializing_if = "Option::is_none" ) ] pub version : Option < String > ,
662
+ /// The name of the runtime (for instance JVM)
663
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
664
+ pub name : Option < String > ,
665
+ /// The version of the runtime
666
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
667
+ pub version : Option < String > ,
586
668
}
587
669
588
670
impl From < ContextType > for Context {
0 commit comments