14个版本 (重大更新)
0.10.0 | 2024年5月11日 |
---|---|
0.9.0 | 2024年3月16日 |
0.8.0 | 2024年3月16日 |
0.5.0 | 2023年10月28日 |
0.0.8 | 2021年11月30日 |
#2480 在 开发工具
1,027 每月下载量
用于 92 个crate(直接使用2个)
10KB
90 行
模块 :: inspect_type
用于检查变量类型及其大小的诊断工具。
基本用例
// #![ 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
}
添加到您的项目中
cargo add inspect_type
从仓库尝试
git clone https://github.com/Wandalen/wTools
cd wTools
cargo run --example inspect_type_trivial