Helper methods to determine whether a type is TraitObject
, Slice
or Concrete
, and work with them respectively.
```rust asserteq!(usize::METATYPE, MetaType::Concrete); asserteq!(any::Any::METATYPE, MetaType::TraitObject); assert_eq!(<[u8]>::METATYPE, MetaType::Slice);
let a: Box
let a = [123,456]; asserteq!(a.metatype(), MetaType::Concrete); let a: &[i32] = &a; asserteq!(a.metatype(), MetaType::Slice);
let a: Box
This currently requires Rust nightly for the raw
and specialization
features.
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.