pub fn size_of_unique_allocated_data(root: &dyn Allocative) -> usize
Expand description

Size of data allocated in unique pointers in the struct.

  • Exclude self
  • Exclude shared pointers
  • For unique pointers, include the size of the pointee plus this function recursively

§Example

use allocative::Allocative;

#[derive(Allocative)]
struct Foo {
    data: Vec<u8>,
}

assert_eq!(
    3,
    allocative::size_of_unique_allocated_data(&Foo {
        data: vec![10, 20, 30]
    })
);