mem_viewer 0.2.4

Memory Viewer is a Rust library that provides a macro and display the memory content of various types of variables. It allows users to view the name, type, size, and memory content of a variable in a formatted way. It supports viewing memory content of different data types including integers, floating-point numbers, strings, pointers, vectors, boxed variables, and structs.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
# Overview

`mem_viewer` is a Rust crate that provides a macro `view_mem!` to view the memory content of an arbitrary variable. It supports viewing memory content of different data types including integers, floating-point numbers, strings, pointers, vectors, boxed variables, and structs.

## Usage

Add the following line to your `Cargo.toml` file:

```toml
[dependencies]
mem_viewer = "0.2.4"
```

Then, in your Rust code, you can use the `view_mem!` macro to view the memory content of a variable. Here's an example:

```rust
use mem_viewer::*;

let my_var: u16 = 69;
view_mem!(my_var);
```

This will print the memory content of `my_var` to the console.

## Example Output

```none
Name: my_var
Type: u16
Addr: 000000719ddfdce6
Size: 2 bytes
     Address      | Hex | Dec |    Bin   | ASCII
-------------------Memory Content---------------
 000000719ddfdce6 | 45  | 069 | 01000101 |  E
 000000719ddfdce7 | 00  | 000 | 00000000 |  NUL
```

Read more for the macro usage: [https://docs.rs/mem_viewer/latest/mem_viewer/macro.view_mem.html](https://docs.rs/mem_viewer/latest/mem_viewer/macro.view_mem.html)

## Safe Usage
For safe mode, you can use the `safe_view_mem!` macro to view the memory content of a variable. Here's an example:
```rust
use mem_viewer::*;

let my_var: u16 = 69;
safe_view_mem!(&my_var);
```

## Example Safe Output
```none
Name         : &my_var
Type         : &u16
Addr         : 000000719ddfdce6
Size         : 8 bytes
Container Ptr: 00000260c1266610
Container Len: 2
     Address     | Hex | Dec |    Bin   | ASCII
---------------Container Content---------------
00000260c1266610 | 45  | 069 | 01000101 | E
00000260c1266611 | 00  | 000 | 00000000 | NUL
```

Read more for safe usage: [https://docs.rs/mem_viewer/latest/mem_viewer/macro.safe_view_mem.html](https://docs.rs/mem_viewer/latest/mem_viewer/macro.safe_view_mem.html)

## License

This crate is licensed under the MIT License.

## Contributing

Contributions are welcome! If you find any issues or have any suggestions, please open an issue or submit a pull request on [GitHub](https://github.com/ikhwanperwira/mem_viewer).

# Unit Test Report

## Code Test:
```rust
#[cfg(test)]
mod tests {
    use super::*;

    /// Display the memopry content of a u16 variable.
    fn view_mem_u16(my_u16: u16) -> () {
        // Unsafe test
        view_mem!(my_u16);

        // Safe test
        safe_view_mem!(&my_u16);
    }

    /// Displays the memory content of a u64 variable.
    fn view_mem_u64(my_u64: u64) -> () {
        // Unsafe test
        view_mem!(my_u64);

        // Safe test
        safe_view_mem!(&my_u64);
    }

    /// Displays the memory content of a f32 variable.
    fn view_mem_f32(my_f32: f32) -> () {
        // Unsafe test
        view_mem!(my_f32);

        // Safe test
        safe_view_mem!(&my_f32);
    }

    /// Displays the memory content of a string variable.
    fn view_mem_str(my_str: &str) -> () {
        // Unsafe test
        view_mem!(my_str); // Print address of the first character of the my_str
        view_mem!(*my_str); // Print actual content of my_str

        // Safe test
        safe_view_mem!(&my_str);
        safe_view_mem!(my_str);
    }

    /// Displays the memory content of a pointer.
    fn view_mem_ptr<T>(my_ptr: *const T) -> () {
        // Unsafe test
        view_mem!(my_ptr);
        unsafe { view_mem!(*my_ptr); }

        // Safe test
        // Parameterized type is not supported for safe view.
    }

    /// Displays the memory content of a vector variable.
    fn view_mem_vec<T>(my_vec: Vec<T>) -> () {
        // Unsafe test
        view_mem!(my_vec);
        view_mem!(*my_vec);

        // Safe test
        // Parameterized type is not supported for safe view.
    }

    /// Displays the memory content of a boxed variable.
    fn view_mem_box<T>(my_box: Box<T>) -> () {
        // Unsafe test
        view_mem!(&my_box);
        view_mem!(my_box);
        view_mem!(*my_box);

        // Safe test
        // Parameterized type is not supported for safe view.
    }

    /// Displays the memory content of a vector of boxed variables.
    fn view_mem_vec_of_box<T>(my_vec_of_box: Vec<Box<T>>) -> () {
        // Unsafe test
        view_mem!(my_vec_of_box);
        view_mem!(*my_vec_of_box);
        view_mem!(*my_vec_of_box[0]);

        // Safe test
        // Parameterized type is not supported for safe view.
    }

    /// Displays the memory content of a struct variable.
    fn view_mem_struct<T>(my_struct: T) -> () {
        // Unsafe test
        view_mem!(&my_struct);
        view_mem!(my_struct);

        // Parameterized type is not supported for safe view.
    }
     
    struct MyStruct {
        a: u8,
        b: u16,
        c: u32,
    }

    #[derive(Serialize)]
    struct MySerializedStruct {
        a: u8,
        b: u16,
        c: u32,
    }

    #[test]
    fn u16_viewer() {
        println!("This should print the memory of the holy number 69.\n");
        assert_eq!(view_mem_u16(69), ());
    }

    fn u64_viewer() {
        println!("This should print the memory of the holy number 69.\n");
        assert_eq!(view_mem_u64(69), ());
    }

    #[test]
    fn f32_viewer() {
        println!("This should print the memory of pi in IEEE 754 representation, which is 0x4048f5c3.\n");
        assert_eq!(view_mem_f32(3.14), ());
    }

    #[test]
    fn str_viewer() {
        println!("This should print the memory of 'Hello' and its address.\n");
        assert_eq!(view_mem_str("Hello"), ());
    }

    #[test]
    fn ptr_viewer() {
        println!("This should print the memory of a pointer.\n");
        let my_ptr: *const u8 = &69;

        // Safe test
        println!("Currently pointer type is not supported by safe view memory.\n");

        // Unsafe test
        assert_eq!(view_mem_ptr(my_ptr), ());
    }

    #[test]
    fn vec_viewer() {
        println!("This should print the memory address of the vector and the memory of its elements.\n");
        let my_vec: Vec<u8> = vec![69, 255, 254, 253, 70];

        // Safe test
        safe_view_mem!(&my_vec);

        // Unsafe test
        assert_eq!(view_mem_vec(my_vec), ());
    }

    #[test]
    fn box_viewer() {
        println!("This should print the memory address of the box and the memory of its value.\n");
        let my_box: Box<u8> = Box::new(69);

        // Safe test
        safe_view_mem!(&my_box);


        // Unsafe test
        assert_eq!(view_mem_box(my_box), ());
    }

    #[test]
    fn vec_of_box_viewer() {
        println!("This should print the memory address of the vector of boxes and the memory of its elements.\n");
        let my_vec_of_box: Vec<Box<u8>> = vec![Box::new(69), Box::new(255), Box::new(254), Box::new(253), Box::new(70)];

        // Safe test
        safe_view_mem!(&my_vec_of_box);

        // Unsafe test
        assert_eq!(view_mem_vec_of_box(my_vec_of_box), ());
    }

    #[test]
    fn struct_viewer() {
        println!("This should print the memory address of the struct and the memory of its fields.\n");
        let my_struct = MyStruct {
            a: 69,
            b: 255,
            c: 70,
        };

        let my_serialized_struct = MySerializedStruct {
            a: 69,
            b: 255,
            c: 70,
        };

        // Safe test
        safe_view_mem!(&my_serialized_struct);

        // Unsafe test
        assert_eq!(view_mem_struct(my_struct), ());
    }
}
```

## Output Test:
```none
running 8 tests
test tests::ptr_viewer ... ok
test tests::box_viewer ... ok
test tests::f32_viewer ... ok
test tests::str_viewer ... ok
test tests::struct_viewer ... ok
test tests::u16_viewer ... ok
test tests::vec_of_box_viewer ... ok
test tests::vec_viewer ... ok

successes:

---- tests::ptr_viewer stdout ----
This should print the memory of a pointer.

Currently pointer type is not supported by safe view memory.

Name: my_ptr
Type: *const u8
Addr: 00000034619feb00
Size: 8 bytes
     Address      | Hex | Dec |    Bin   | ASCII
-----------------Memory Content-----------------
 00000034619feb00 | f8  | 248 | 11111000 |  ...
 00000034619feb01 | 2f  | 047 | 00101111 |  /
 00000034619feb02 | a6  | 166 | 10100110 |  ...
 00000034619feb03 | 20  | 032 | 00100000 |  SPC
 00000034619feb04 | f6  | 246 | 11110110 |  ...
 00000034619feb05 | 7f  | 127 | 01111111 |  DEL
 00000034619feb06 | 00  | 000 | 00000000 |  NUL
 00000034619feb07 | 00  | 000 | 00000000 |  NUL

Name: *my_ptr
Type: u8
Addr: 00007ff620a62ff8
Size: 1 bytes
     Address      | Hex | Dec |    Bin   | ASCII
-----------------Memory Content-----------------
 00007ff620a62ff8 | 45  | 069 | 01000101 |  E


---- tests::box_viewer stdout ----
This should print the memory address of the box and the memory of its value.

Name         : &my_box
Type         : &alloc::boxed::Box<u8>
Addr         : 00000034615fdfd8
Size         : 8 bytes
Container Ptr: 000001e2998cb200
Container Len: 1
     Address     | Hex | Dec |    Bin   | ASCII
---------------Container Content---------------
000001e2998cb200 | 45  | 069 | 01000101 | E

Name: &my_box
Type: &alloc::boxed::Box<u8>
Addr: 00000034615fd968
Size: 8 bytes
     Address      | Hex | Dec |    Bin   | ASCII
-----------------Memory Content-----------------
 00000034615fda50 | c8  | 200 | 11001000 |  ...
 00000034615fda51 | d8  | 216 | 11011000 |  ...
 00000034615fda52 | 5f  | 095 | 01011111 |  _
 00000034615fda53 | 61  | 097 | 01100001 |  a
 00000034615fda54 | 34  | 052 | 00110100 |  4
 00000034615fda55 | 00  | 000 | 00000000 |  NUL
 00000034615fda56 | 00  | 000 | 00000000 |  NUL
 00000034615fda57 | 00  | 000 | 00000000 |  NUL

Name: my_box
Type: alloc::boxed::Box<u8>
Addr: 00000034615fd8c8
Size: 8 bytes
     Address      | Hex | Dec |    Bin   | ASCII
-----------------Memory Content-----------------
 00000034615fd8c8 | 00  | 000 | 00000000 |  NUL
 00000034615fd8c9 | b3  | 179 | 10110011 |  ...
 00000034615fd8ca | 8c  | 140 | 10001100 |  ...
 00000034615fd8cb | 99  | 153 | 10011001 |  ...
 00000034615fd8cc | e2  | 226 | 11100010 |  ...
 00000034615fd8cd | 01  | 001 | 00000001 |  SOH
 00000034615fd8ce | 00  | 000 | 00000000 |  NUL
 00000034615fd8cf | 00  | 000 | 00000000 |  NUL

Name: *my_box
Type: u8
Addr: 000001e2998cb300
Size: 1 bytes
     Address      | Hex | Dec |    Bin   | ASCII
-----------------Memory Content-----------------
 000001e2998cb300 | 45  | 069 | 01000101 |  E


---- tests::f32_viewer stdout ----
This should print the memory of pi in IEEE 754 representation, which is 0x4048f5c3.

Name: my_f32
Type: f32
Addr: 00000034617fdf14
Size: 4 bytes
     Address      | Hex | Dec |    Bin   | ASCII
-----------------Memory Content-----------------
 00000034617fdf14 | c3  | 195 | 11000011 |  ...
 00000034617fdf15 | f5  | 245 | 11110101 |  ...
 00000034617fdf16 | 48  | 072 | 01001000 |  H
 00000034617fdf17 | 40  | 064 | 01000000 |  @

Name         : &my_f32
Type         : &f32
Addr         : 00000034617fdf14
Size         : 8 bytes
Container Ptr: 000001e2998d1c40
Container Len: 4
     Address     | Hex | Dec |    Bin   | ASCII
---------------Container Content---------------
000001e2998d1c40 | c3  | 195 | 11000011 | ...
000001e2998d1c41 | f5  | 245 | 11110101 | ...
000001e2998d1c42 | 48  | 072 | 01001000 | H
000001e2998d1c43 | 40  | 064 | 01000000 | @


---- tests::str_viewer stdout ----
This should print the memory of 'Hello' and its address.

Name: my_str
Type: &str
Addr: 0000003461bfcaf8
Size: 16 bytes
     Address      | Hex | Dec |    Bin   | ASCII
-----------------Memory Content-----------------
 0000003461bfcaf8 | 98  | 152 | 10011000 |  ...
 0000003461bfcaf9 | 2f  | 047 | 00101111 |  /
 0000003461bfcafa | a6  | 166 | 10100110 |  ...
 0000003461bfcafb | 20  | 032 | 00100000 |  SPC
 0000003461bfcafc | f6  | 246 | 11110110 |  ...
 0000003461bfcafd | 7f  | 127 | 01111111 |  DEL
 0000003461bfcafe | 00  | 000 | 00000000 |  NUL
 0000003461bfcaff | 00  | 000 | 00000000 |  NUL
 0000003461bfcb00 | 05  | 005 | 00000101 |  ENQ
 0000003461bfcb01 | 00  | 000 | 00000000 |  NUL
 0000003461bfcb02 | 00  | 000 | 00000000 |  NUL
 0000003461bfcb03 | 00  | 000 | 00000000 |  NUL
 0000003461bfcb04 | 00  | 000 | 00000000 |  NUL
 0000003461bfcb05 | 00  | 000 | 00000000 |  NUL
 0000003461bfcb06 | 00  | 000 | 00000000 |  NUL
 0000003461bfcb07 | 00  | 000 | 00000000 |  NUL

Name: *my_str
Type: str
Addr: 00007ff620a62f98
Size: 5 bytes
     Address      | Hex | Dec |    Bin   | ASCII
-----------------Memory Content-----------------
 00007ff620a62f98 | 48  | 072 | 01001000 |  H
 00007ff620a62f99 | 65  | 101 | 01100101 |  e
 00007ff620a62f9a | 6c  | 108 | 01101100 |  l
 00007ff620a62f9b | 6c  | 108 | 01101100 |  l
 00007ff620a62f9c | 6f  | 111 | 01101111 |  o

Name         : &my_str
Type         : &&str
Addr         : 0000003461bfcaf8
Size         : 8 bytes
Container Ptr: 000001e2998d1c30
Container Len: 5
     Address     | Hex | Dec |    Bin   | ASCII
---------------Container Content---------------
000001e2998d1c30 | 48  | 072 | 01001000 | H
000001e2998d1c31 | 65  | 101 | 01100101 | e
000001e2998d1c32 | 6c  | 108 | 01101100 | l
000001e2998d1c33 | 6c  | 108 | 01101100 | l
000001e2998d1c34 | 6f  | 111 | 01101111 | o

Name         : my_str
Type         : &str
Addr         : 00007ff620a62f98
Size         : 16 bytes
Container Ptr: 000001e2998d1c40
Container Len: 5
     Address     | Hex | Dec |    Bin   | ASCII
---------------Container Content---------------
000001e2998d1c40 | 48  | 072 | 01001000 | H
000001e2998d1c41 | 65  | 101 | 01100101 | e
000001e2998d1c42 | 6c  | 108 | 01101100 | l
000001e2998d1c43 | 6c  | 108 | 01101100 | l
000001e2998d1c44 | 6f  | 111 | 01101111 | o


---- tests::struct_viewer stdout ----
This should print the memory address of the struct and the memory of its fields.

Name         : &my_serialized_struct
Type         : &mem_viewer::tests::MySerializedStruct
Addr         : 0000003461dfe168
Size         : 8 bytes
Container Ptr: 000001e2998cb350
Container Len: 7
     Address     | Hex | Dec |    Bin   | ASCII
---------------Container Content---------------
000001e2998cb350 | 45  | 069 | 01000101 | E
000001e2998cb351 | ff  | 255 | 11111111 | ...
000001e2998cb352 | 00  | 000 | 00000000 | NUL
000001e2998cb353 | 46  | 070 | 01000110 | F
000001e2998cb354 | 00  | 000 | 00000000 | NUL
000001e2998cb355 | 00  | 000 | 00000000 | NUL
000001e2998cb356 | 00  | 000 | 00000000 | NUL

Name: &my_struct
Type: &mem_viewer::tests::MyStruct
Addr: 0000003461dfdcb8
Size: 8 bytes
     Address      | Hex | Dec |    Bin   | ASCII
-----------------Memory Content-----------------
 0000003461dfdda0 | 10  | 016 | 00010000 |  DLE
 0000003461dfdda1 | dc  | 220 | 11011100 |  ...
 0000003461dfdda2 | df  | 223 | 11011111 |  ...
 0000003461dfdda3 | 61  | 097 | 01100001 |  a
 0000003461dfdda4 | 34  | 052 | 00110100 |  4
 0000003461dfdda5 | 00  | 000 | 00000000 |  NUL
 0000003461dfdda6 | 00  | 000 | 00000000 |  NUL
 0000003461dfdda7 | 00  | 000 | 00000000 |  NUL

Name: my_struct
Type: mem_viewer::tests::MyStruct
Addr: 0000003461dfdc10
Size: 8 bytes
     Address      | Hex | Dec |    Bin   | ASCII
-----------------Memory Content-----------------
 0000003461dfdc10 | 46  | 070 | 01000110 |  F
 0000003461dfdc11 | 00  | 000 | 00000000 |  NUL
 0000003461dfdc12 | 00  | 000 | 00000000 |  NUL
 0000003461dfdc13 | 00  | 000 | 00000000 |  NUL
 0000003461dfdc14 | ff  | 255 | 11111111 |  ...
 0000003461dfdc15 | 00  | 000 | 00000000 |  NUL
 0000003461dfdc16 | 45  | 069 | 01000101 |  E
 0000003461dfdc17 | 00  | 000 | 00000000 |  NUL


---- tests::u16_viewer stdout ----
This should print the memory of the holy number 69.

Name: my_u16
Type: u16
Addr: 0000003461ffe006
Size: 2 bytes
     Address      | Hex | Dec |    Bin   | ASCII
-----------------Memory Content-----------------
 0000003461ffe006 | 45  | 069 | 01000101 |  E
 0000003461ffe007 | 00  | 000 | 00000000 |  NUL

Name         : &my_u16
Type         : &u16
Addr         : 0000003461ffe006
Size         : 8 bytes
Container Ptr: 000001e2998cb220
Container Len: 2
     Address     | Hex | Dec |    Bin   | ASCII
---------------Container Content---------------
000001e2998cb220 | 45  | 069 | 01000101 | E
000001e2998cb221 | 00  | 000 | 00000000 | NUL


---- tests::vec_of_box_viewer stdout ----
This should print the memory address of the vector of boxes and the memory of its elements.

Name         : &my_vec_of_box
Type         : &alloc::vec::Vec<alloc::boxed::Box<u8>>
Addr         : 00000034615fe530
Size         : 8 bytes
Container Ptr: 000001e2998d1c00
Container Len: 5
     Address     | Hex | Dec |    Bin   | ASCII
---------------Container Content---------------
000001e2998d1c00 | 45  | 069 | 01000101 | E
000001e2998d1c01 | ff  | 255 | 11111111 | ...
000001e2998d1c02 | fe  | 254 | 11111110 | ...
000001e2998d1c03 | fd  | 253 | 11111101 | ...
000001e2998d1c04 | 46  | 070 | 01000110 | F

Name: my_vec_of_box
Type: alloc::vec::Vec<alloc::boxed::Box<u8>>
Addr: 00000034615ff0d0
Size: 24 bytes
     Address      | Hex | Dec |    Bin   | ASCII
-----------------Memory Content-----------------
 00000034615ff0d0 | 05  | 005 | 00000101 |  ENQ
 00000034615ff0d1 | 00  | 000 | 00000000 |  NUL
 00000034615ff0d2 | 00  | 000 | 00000000 |  NUL
 00000034615ff0d3 | 00  | 000 | 00000000 |  NUL
 00000034615ff0d4 | 00  | 000 | 00000000 |  NUL
 00000034615ff0d5 | 00  | 000 | 00000000 |  NUL
 00000034615ff0d6 | 00  | 000 | 00000000 |  NUL
 00000034615ff0d7 | 00  | 000 | 00000000 |  NUL
 00000034615ff0d8 | 50  | 080 | 01010000 |  P
 00000034615ff0d9 | 85  | 133 | 10000101 |  ...
 00000034615ff0da | 8c  | 140 | 10001100 |  ...
 00000034615ff0db | 99  | 153 | 10011001 |  ...
 00000034615ff0dc | e2  | 226 | 11100010 |  ...
 00000034615ff0dd | 01  | 001 | 00000001 |  SOH
 00000034615ff0de | 00  | 000 | 00000000 |  NUL
 00000034615ff0df | 00  | 000 | 00000000 |  NUL
 00000034615ff0e0 | 05  | 005 | 00000101 |  ENQ
 00000034615ff0e1 | 00  | 000 | 00000000 |  NUL
 00000034615ff0e2 | 00  | 000 | 00000000 |  NUL
 00000034615ff0e3 | 00  | 000 | 00000000 |  NUL
 00000034615ff0e4 | 00  | 000 | 00000000 |  NUL
 00000034615ff0e5 | 00  | 000 | 00000000 |  NUL
 00000034615ff0e6 | 00  | 000 | 00000000 |  NUL
 00000034615ff0e7 | 00  | 000 | 00000000 |  NUL

Name: *my_vec_of_box
Type: [alloc::boxed::Box<u8>]
Addr: 000001e2998c8550
Size: 40 bytes
     Address      | Hex | Dec |    Bin   | ASCII
-----------------Memory Content-----------------
 000001e2998c8550 | 90  | 144 | 10010000 |  ...
 000001e2998c8551 | 1c  | 028 | 00011100 |  FS
 000001e2998c8552 | 8d  | 141 | 10001101 |  ...
 000001e2998c8553 | 99  | 153 | 10011001 |  ...
 000001e2998c8554 | e2  | 226 | 11100010 |  ...
 000001e2998c8555 | 01  | 001 | 00000001 |  SOH
 000001e2998c8556 | 00  | 000 | 00000000 |  NUL
 000001e2998c8557 | 00  | 000 | 00000000 |  NUL
 000001e2998c8558 | 80  | 128 | 10000000 |  ...
 000001e2998c8559 | 1c  | 028 | 00011100 |  FS
 000001e2998c855a | 8d  | 141 | 10001101 |  ...
 000001e2998c855b | 99  | 153 | 10011001 |  ...
 000001e2998c855c | e2  | 226 | 11100010 |  ...
 000001e2998c855d | 01  | 001 | 00000001 |  SOH
 000001e2998c855e | 00  | 000 | 00000000 |  NUL
 000001e2998c855f | 00  | 000 | 00000000 |  NUL
 000001e2998c8560 | a0  | 160 | 10100000 |  ...
 000001e2998c8561 | 1c  | 028 | 00011100 |  FS
 000001e2998c8562 | 8d  | 141 | 10001101 |  ...
 000001e2998c8563 | 99  | 153 | 10011001 |  ...
 000001e2998c8564 | e2  | 226 | 11100010 |  ...
 000001e2998c8565 | 01  | 001 | 00000001 |  SOH
 000001e2998c8566 | 00  | 000 | 00000000 |  NUL
 000001e2998c8567 | 00  | 000 | 00000000 |  NUL
 000001e2998c8568 | 40  | 064 | 01000000 |  @
 000001e2998c8569 | 1c  | 028 | 00011100 |  FS
 000001e2998c856a | 8d  | 141 | 10001101 |  ...
 000001e2998c856b | 99  | 153 | 10011001 |  ...
 000001e2998c856c | e2  | 226 | 11100010 |  ...
 000001e2998c856d | 01  | 001 | 00000001 |  SOH
 000001e2998c856e | 00  | 000 | 00000000 |  NUL
 000001e2998c856f | 00  | 000 | 00000000 |  NUL
 000001e2998c8570 | 60  | 096 | 01100000 |  `
 000001e2998c8571 | 1c  | 028 | 00011100 |  FS
 000001e2998c8572 | 8d  | 141 | 10001101 |  ...
 000001e2998c8573 | 99  | 153 | 10011001 |  ...
 000001e2998c8574 | e2  | 226 | 11100010 |  ...
 000001e2998c8575 | 01  | 001 | 00000001 |  SOH
 000001e2998c8576 | 00  | 000 | 00000000 |  NUL
 000001e2998c8577 | 00  | 000 | 00000000 |  NUL

Name: *my_vec_of_box[0]
Type: u8
Addr: 000001e2998d1c90
Size: 1 bytes
     Address      | Hex | Dec |    Bin   | ASCII
-----------------Memory Content-----------------
 000001e2998d1c90 | 45  | 069 | 01000101 |  E


---- tests::vec_viewer stdout ----
This should print the memory address of the vector and the memory of its elements.

Name         : &my_vec
Type         : &alloc::vec::Vec<u8>
Addr         : 00000034615fe508
Size         : 8 bytes
Container Ptr: 000001e2998d1c60
Container Len: 5
     Address     | Hex | Dec |    Bin   | ASCII
---------------Container Content---------------
000001e2998d1c60 | 45  | 069 | 01000101 | E
000001e2998d1c61 | ff  | 255 | 11111111 | ...
000001e2998d1c62 | fe  | 254 | 11111110 | ...
000001e2998d1c63 | fd  | 253 | 11111101 | ...
000001e2998d1c64 | 46  | 070 | 01000110 | F

Name: my_vec
Type: alloc::vec::Vec<u8>
Addr: 00000034615ff080
Size: 24 bytes
     Address      | Hex | Dec |    Bin   | ASCII
-----------------Memory Content-----------------
 00000034615ff080 | 05  | 005 | 00000101 |  ENQ
 00000034615ff081 | 00  | 000 | 00000000 |  NUL
 00000034615ff082 | 00  | 000 | 00000000 |  NUL
 00000034615ff083 | 00  | 000 | 00000000 |  NUL
 00000034615ff084 | 00  | 000 | 00000000 |  NUL
 00000034615ff085 | 00  | 000 | 00000000 |  NUL
 00000034615ff086 | 00  | 000 | 00000000 |  NUL
 00000034615ff087 | 00  | 000 | 00000000 |  NUL
 00000034615ff088 | 40  | 064 | 01000000 |  @
 00000034615ff089 | 1c  | 028 | 00011100 |  FS
 00000034615ff08a | 8d  | 141 | 10001101 |  ...
 00000034615ff08b | 99  | 153 | 10011001 |  ...
 00000034615ff08c | e2  | 226 | 11100010 |  ...
 00000034615ff08d | 01  | 001 | 00000001 |  SOH
 00000034615ff08e | 00  | 000 | 00000000 |  NUL
 00000034615ff08f | 00  | 000 | 00000000 |  NUL
 00000034615ff090 | 05  | 005 | 00000101 |  ENQ
 00000034615ff091 | 00  | 000 | 00000000 |  NUL
 00000034615ff092 | 00  | 000 | 00000000 |  NUL
 00000034615ff093 | 00  | 000 | 00000000 |  NUL
 00000034615ff094 | 00  | 000 | 00000000 |  NUL
 00000034615ff095 | 00  | 000 | 00000000 |  NUL
 00000034615ff096 | 00  | 000 | 00000000 |  NUL
 00000034615ff097 | 00  | 000 | 00000000 |  NUL

Name: *my_vec
Type: [u8]
Addr: 000001e2998d1c40
Size: 5 bytes
     Address      | Hex | Dec |    Bin   | ASCII
-----------------Memory Content-----------------
 000001e2998d1c40 | 45  | 069 | 01000101 |  E
 000001e2998d1c41 | ff  | 255 | 11111111 |  ...
 000001e2998d1c42 | fe  | 254 | 11111110 |  ...
 000001e2998d1c43 | fd  | 253 | 11111101 |  ...
 000001e2998d1c44 | 46  | 070 | 01000110 |  F



successes:
    tests::box_viewer
    tests::f32_viewer
    tests::ptr_viewer
    tests::str_viewer
    tests::struct_viewer
    tests::u16_viewer
    tests::vec_of_box_viewer
    tests::vec_viewer

test result: ok. 8 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
```