Returns type names with a specifiable number of module segments as a String
.
```rust // === std library === // asserteq!( std::any::typename::
// === tynm === // // Simple type name: asserteq!(tynm::typename::
// Type name with 1 module segment, starting from the most significant module. asserteq!( tynm::typenamem::
// Type name with 1 module segment, starting from the least significant module. asserteq!( tynm::typenamen::
// Type name with 1 module segment from both the most and least significant modules.
mod rustout { pub mod two { pub mod three { pub struct Struct; } } }
asserteq!(
tynm::typenamemn::
The [std::any::type_name
] function stabilized in Rust 1.38 returns the fully qualified type
name with all module segments. This can be difficult to read in error messages, especially for
type-parameterized types.
Often, the simple type name is more readable, and enough to distinguish the type referenced in an error.
Licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.