#type-name #guide #list

deprecated typename

Stable alternative to Rust's type_name intrinsic

3 releases

Uses old Rust 2015

0.1.2 Nov 26, 2019
0.1.1 Apr 19, 2019
0.1.0 Dec 4, 2017

#11 in #type-name

Download history 193/week @ 2024-12-09 116/week @ 2024-12-16 24/week @ 2024-12-23 53/week @ 2024-12-30 81/week @ 2025-01-06 121/week @ 2025-01-13 117/week @ 2025-01-20 66/week @ 2025-01-27 250/week @ 2025-02-03 244/week @ 2025-02-10 113/week @ 2025-02-17 141/week @ 2025-02-24 147/week @ 2025-03-03 286/week @ 2025-03-10 222/week @ 2025-03-17 180/week @ 2025-03-24

842 downloads per month
Used in 4 crates

MIT/Apache

19KB
280 lines

typename

Build Status Latest Version Documentation

A compatible, safe and stable alternative to Rust's std::intrinsics::type_name intrinsic.

DEPRECATION NOTICE: This crate has been deprecated. The type_name intrinsic has been stablized in Rust 1.38. Users of this crate are asked to migrate to std::any::type_name.

Example

extern crate typename;

use typename::TypeName;

fn main() {
    assert_eq!(String::type_name(), "std::string::String");
    assert_eq!(Vec::<i32>::type_name(), "std::vec::Vec<i32>");
    assert_eq!([0, 1, 2].type_name_of(), "[i32; 3]");
}

Contribute

typename is part of the Strymon project:

License

typename is primarily distributed under the terms of both the MIT license and the Apache License (Version 2.0), with portions covered by various BSD-like licenses.

See LICENSE-APACHE, and LICENSE-MIT for details.

Dependencies

~240KB