Registry / utility / deepsize

deepsize

JSON →
library0.2.0rscratesunverified

A crate for measuring the total size of object on the stack and heap.

# Cargo.toml [dependencies] deepsize = "0.2.0"
INSTALL
IMPORT
SIG · DEEPSIZE
D
deepsize
utilityrustv0.2.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

DeepSizeOf
use deepsize::DeepSizeOf;

Measures the total memory footprint of a struct including heap allocations.

use deepsize::DeepSizeOf; #[derive(DeepSizeOf)] struct MyStruct { data: Vec<u8>, } fn main() { let obj = MyStruct { data: vec![0; 100] }; println!("Total size: {} bytes", obj.deep_size_of()); }
Debug
Known issues
gotchaRequires the `derive` feature to use `#[derive(DeepSizeOf)]`.
fix
Add `features = ["derive"]` to your Cargo.toml dependency.
affects: >=0.2.0
Upgrade
Version history
0.2.0latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
7 hits · last 30 days
node
6
Amazon
1
Resources
deepsize — cargo add deepsize · libregistry