Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/trace_json_spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ A special marker used when a previously emitted `Step` should be ignored. It kee
Many events embed `ValueRecord` objects. They all use an internally tagged representation with a `kind` field. The possible variants are:

* `Int` – `{ "kind": "Int", "i": number, "type_id": TypeId }`
* `Int128` – `{ "kind": "Int128", "i": number, "type_id": TypeId }`
* `Float` – `{ "kind": "Float", "f": number, "type_id": TypeId }`
* `Bool` – `{ "kind": "Bool", "b": true|false, "type_id": TypeId }`
* `String` – `{ "kind": "String", "text": "...", "type_id": TypeId }`
Expand Down
10 changes: 10 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,4 +155,14 @@ mod tests {
assert_eq!(a, b);
assert_ne!(a, different);
}

#[test]
fn test_i128_value_record() {
let a = ValueRecord::Int128 { i: 0, type_id: TypeId(0) };
let b = ValueRecord::Int128 { i: 0, type_id: TypeId(0) };
let different = ValueRecord::Int128 { i: 1, type_id: TypeId(0) };

assert_eq!(a, b);
assert_ne!(a, different);
}
}
4 changes: 4 additions & 0 deletions src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,10 @@ pub enum ValueRecord {
i: i64,
type_id: TypeId,
},
Int128 {
i: i128,
type_id: TypeId,
},
Float {
f: f64,
type_id: TypeId,
Expand Down