https://github.com/taskie/binspect
Rust utilities to inspect the data layout of objects.
https://github.com/taskie/binspect
debug rust
Last synced: 9 months ago
JSON representation
Rust utilities to inspect the data layout of objects.
- Host: GitHub
- URL: https://github.com/taskie/binspect
- Owner: taskie
- License: apache-2.0
- Created: 2021-06-10T02:21:58.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2023-04-14T17:21:37.000Z (about 3 years ago)
- Last Synced: 2025-09-16T13:45:18.848Z (9 months ago)
- Topics: debug, rust
- Language: Rust
- Homepage:
- Size: 32.2 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
# binspect
[](https://github.com/taskie/binspect/actions)
[](https://crates.io/crates/binspect)
[](https://docs.rs/binspect)

Rust 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](https://doc.rust-lang.org/stable/nomicon/data.html) in detail.
## Usage
```rust
use binspect::binspect;
let s = "ABC";
binspect!(s);
binspect!(*s);
```
An example of output (depends on compilation and runtime environments):
```text
-----+ 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
```
## Examples
See [examples.md](examples.md) and [its original source](examples/all.rs).
## License
MIT or Apache-2.0