[−][src]Enum genie_support::StringKey
A key in a language file.
A key may be either a nonnegative integer or an arbitrary string.
The original game supports only nonnegative integers. The HD Edition allows for integers as well as Strings to serve as keys in a key value file.
Variants
Num(u32)
An integer string key.
Name(String)
A named string key.
The string must not represent a u32
value (such keys must be Num
).
Implementations
impl StringKey
[src]
pub fn is_numeric(&self) -> bool
[src]
Returns true
if and only if this StringKey
is a number.
Examples
use genie_support::StringKey; use std::convert::TryFrom; assert!(StringKey::try_from(0).unwrap().is_numeric()); assert!(!StringKey::from("").is_numeric());
pub fn is_named(&self) -> bool
[src]
Returns true
if and only if this StringKey
is a string name.
Examples
use genie_support::StringKey; use std::convert::TryFrom; assert!(!StringKey::try_from(0).unwrap().is_named()); assert!(StringKey::from("").is_named());
Trait Implementations
impl Clone for StringKey
[src]
impl Debug for StringKey
[src]
impl Default for StringKey
[src]
impl Display for StringKey
[src]
impl Eq for StringKey
[src]
impl<'_> From<&'_ str> for StringKey
[src]
impl From<String> for StringKey
[src]
impl From<u16> for StringKey
[src]
impl From<u32> for StringKey
[src]
impl Hash for StringKey
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl PartialEq<StringKey> for StringKey
[src]
impl StructuralEq for StringKey
[src]
impl StructuralPartialEq for StringKey
[src]
impl<'_> TryFrom<&'_ StringKey> for u32
[src]
type Error = TryFromStringKeyError
The type returned in the event of a conversion error.
fn try_from(key: &StringKey) -> Result<Self, Self::Error>
[src]
impl<'_> TryFrom<&'_ StringKey> for i32
[src]
type Error = TryFromStringKeyError
The type returned in the event of a conversion error.
fn try_from(key: &StringKey) -> Result<Self, Self::Error>
[src]
impl<'_> TryFrom<&'_ StringKey> for u16
[src]
type Error = TryFromStringKeyError
The type returned in the event of a conversion error.
fn try_from(key: &StringKey) -> Result<Self, Self::Error>
[src]
impl<'_> TryFrom<&'_ StringKey> for i16
[src]
type Error = TryFromStringKeyError
The type returned in the event of a conversion error.
fn try_from(key: &StringKey) -> Result<Self, Self::Error>
[src]
impl TryFrom<i16> for StringKey
[src]
type Error = TryFromIntError
The type returned in the event of a conversion error.
fn try_from(n: i16) -> Result<Self, Self::Error>
[src]
impl TryFrom<i32> for StringKey
[src]
Auto Trait Implementations
impl RefUnwindSafe for StringKey
impl Send for StringKey
impl Sync for StringKey
impl Unpin for StringKey
impl UnwindSafe for StringKey
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,