[][src]Macro deepsize::known_deep_size

macro_rules! known_deep_size {
    ($size:expr, $($type:ty),+) => { ... };
    ($size:expr, $($type:ident<$($gen:ident),+>),+) => { ... };
}

A macro to generate an impl for types with known inner allocation sizes.

Repurposed from the heapsize crate

Usage:

struct A(u32);
struct B(A, char);
struct C(Box<u32>);

known_deep_size!(0, A, B); // A and B do not have any allocation
known_deep_size!(4, C); // C will always have an allocation of 4 bytes