1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
use crate::RawStr;

/// Something that is named.
pub trait Named {
    /// The name of the named thing.
    const NAME: RawStr;
}

impl Named for String {
    const NAME: RawStr = RawStr::from_str("String");
}

impl Named for i64 {
    const NAME: RawStr = RawStr::from_str("int");
}

impl Named for f64 {
    const NAME: RawStr = RawStr::from_str("float");
}

impl Named for u8 {
    const NAME: RawStr = RawStr::from_str("byte");
}

impl Named for char {
    const NAME: RawStr = RawStr::from_str("char");
}

impl Named for bool {
    const NAME: RawStr = RawStr::from_str("bool");
}