summaryrefslogtreecommitdiff
path: root/ecs/src/type_name.rs
blob: 54179bef3be4fb07183ec63f427bf50ab25fd1f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use std::any::type_name;

pub trait TypeName
{
    /// Returns the name of this type.
    fn type_name(&self) -> &'static str;
}

impl<Item> TypeName for Vec<Item>
{
    fn type_name(&self) -> &'static str
    {
        type_name::<Self>()
    }
}