Crate inspect_type[][src]

Expand description

Diagnostic-purpose tools to inspect type of a variable and its size.

Sample

// #![ feature( type_name_of_val ) ]
#![ cfg_attr( feature = "nightly", feature( type_name_of_val ) ) ]

use inspect_type::*;

#[ rustversion::nightly ]
fn main()
{
  inspect_type_of!( &[ 1, 2, 3 ][ .. ] );
  // < sizeof( &[1, 2, 3][..] : &[i32] ) = 16
  inspect_type_of!( &[ 1, 2, 3 ] );
  // < sizeof( &[1, 2, 3] : &[i32; 3] ) = 8
}

#[ rustversion::stable ]
fn main()
{
}

Macros

Macro to inspect type of a variable and its size exporting it as a string.

Macro to inspect type of a variable and its size printing into stdout and exporting it as a string.