[][src]Macro succinct::impl_stack_only_space_usage

macro_rules! impl_stack_only_space_usage {
    ( $t:ty ) => { ... };
}

Implements SpaceUsage for a stack-only (Copy) type.

Example

use std::mem;
use succinct::SpaceUsage;

struct Point { x: u32, y: u32 }

impl_stack_only_space_usage!(Point);

fn main() {
    let point = Point { x: 0, y: 0 };
    assert_eq!(point.total_bytes(), mem::size_of::<Point>());
}