Crate binspect[][src]

Expand description

Utilities to inspect the data layout of objects.

This library is for debugging only because data layout of Rust is not be stabilized. Please read Data Layout - The Rustonomicon in detail.

Examples

use binspect::binspect;

let s = "ABC";
binspect!(s);
binspect!(*s);

An example of output (depends on compilation and runtime environments):

-----+ 0x7ffce3c8f7a0: &str = s
0000 | 49 03 b4 2f 2c 56 00 00 : 03 00 00 00 00 00 00 00
-----+ 0x562c2fb40349: str = *s
0000 | 41 42 43

Macros

binspect

Prints the memory address and the hex representation of an object to stdout.

ebinspect

Prints the memory address and the hex representation of an object to stderr.

write_binspect

Writes the memory address and the hex representation of an object to std::io::Write.