Derive Macro loupe_derive::MemoryUsage[][src]

#[derive(MemoryUsage)]
{
    // Attributes available to this derive:
    #[loupe]
}

Procedural macro to implement the loupe::MemoryUsage trait automatically for structs and enums.

All struct fields and enum variants must implement MemoryUsage trait. If it’s not possible, the #[loupe(skip)] attribute can be used on a field or a variant to instruct the derive procedural macro to skip that item.

Example

#[derive(MemoryUsage)]
struct Point {
    x: i32,
    y: i32,
}

struct Mystery { ptr: *const i32 }

#[derive(MemoryUsage)]
struct S {
    points: Vec<Point>,

    #[loupe(skip)]
    other: Mystery,
}