<!-- {{# generate.module_header{} #}} -->
# Module :: inspect_type
[](https://github.com/emersion/stability-badges#experimental) [](https://github.com/Wandalen/wTools/actions/workflows/ModuleInspectTypePush.yml) [](https://docs.rs/inspect_type) [](https://gitpod.io/#RUN_PATH=.,SAMPLE_FILE=sample%2Frust%2Finspect_type_trivial_sample%2Fsrc%2Fmain.rs,RUN_POSTFIX=--example%20inspect_type_trivial_sample/https://github.com/Wandalen/wTools) [](https://discord.gg/m3YfbXpUUY)
Diagnostic-purpose tools to inspect type of a variable and its size.
### Basic use-case.
<!-- {{# generate.module_sample{} #}} -->
```rust
#![ cfg_attr( feature = "nightly", feature( type_name_of_val ) ) ]
pub use inspect_type::*;
#[ cfg( feature = "nightly" ) ]
{
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
}
```
### To add to your project
```sh
cargo add inspect_type
```
### Try out from the repository
```sh
git clone https://github.com/Wandalen/wTools
cd wTools
cargo run --example inspect_type_trivial_sample
```