/// Returns the single character denoting this tag's type, or `None` if this tag has no type
/// specifier.
///
/// # Examples
///
/// ```
/// # use quartz_nbt::NbtTag;
/// assert_eq!(NbtTag::Long(10).type_specifier(), Some("L"));
/// assert_eq!(NbtTag::IntArray(Vec::new()).type_specifier(), Some("I"));
/// assert_eq!(NbtTag::String(String::new()).type_specifier(), None);
/// ```
Returns the single character denoting this tag's type, or `None` if this tag has no type
specifier.
Returns the single character denoting this tag ' s type or ` None ` if this tag has no type specifier .
pub fn type_specifier(&self) -> Option<&'static str> {
        match self {
            NbtTag::Byte(_) => Some("B"),
            NbtTag::Short(_) => Some("S"),
            NbtTag::Long(_) => Some("L"),
            NbtTag::Float(_) => Some("F"),
            NbtTag::Double(_) => Some("D"),
            NbtTag::ByteArray(_) => Some("B"),
            NbtTag::IntArray(_) => Some("I"),
            NbtTag::LongArray(_) => Some("L"),
            _ => None,
        }
    }
pub fn type_specifier ( & self ) -> Option < & ' static str > { match self { NbtTag :: Byte ( _ ) => Some ( " " ) , NbtTag :: Short ( _ ) => Some ( " " ) , NbtTag :: Long ( _ ) => Some ( " " ) , NbtTag :: Float ( _ ) => Some ( " " ) , NbtTag :: Double ( _ ) => Some ( " " ) , NbtTag :: ByteArray ( _ ) => Some ( " " ) , NbtTag :: IntArray ( _ ) => Some ( " " ) , NbtTag :: LongArray ( _ ) => Some ( " " ) , _ => None , } }
Returns the single character denoting this tag's type, or `None` if this tag has no type
specifier.
Returns the single character denoting this tag ' s type or ` None ` if this tag has no type specifier .
&self
examples
None
use quartz_nbt::nbttag;
assert_eq!(NbtTag::Long(10).type_specifier(), Some("L"));
assert_eq!(NbtTag::IntArray(Vec::new()).type_specifier(), Some("I"));
assert_eq!(NbtTag::String(String::new()).type_specifier(), None);
```
assert_eq! ( NbtTag :: Long ( 10 ) . type_specifier () Some ( " L " )) ; assert_eq! ( NbtTag :: IntArray ( Vec :: new () ) . type_specifier () Some ( " I " )) ; assert_eq! ( NbtTag :: String ( String :: new () ) . type_specifier () None ) ; ` ` `