pub struct StatId(/* private fields */);Expand description
Interned string identifier for stats.
Uses Arc<str> for memory efficiency and fast comparison.
Multiple StatId instances with the same string content share the same
underlying allocation.
§Examples
use zzstat::StatId;
let hp = StatId::from("HP");
let atk = StatId::from("ATK");
// Can be created from string slices or owned strings
let hp2: StatId = "HP".into();
let hp3: StatId = String::from("HP").into();
assert_eq!(hp, hp2);
assert_eq!(hp, hp3);Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for StatId
impl<'de> Deserialize<'de> for StatId
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for StatId
Source§impl Ord for StatId
impl Ord for StatId
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for StatId
impl PartialOrd for StatId
impl StructuralPartialEq for StatId
Auto Trait Implementations§
impl Freeze for StatId
impl RefUnwindSafe for StatId
impl Send for StatId
impl Sync for StatId
impl Unpin for StatId
impl UnsafeUnpin for StatId
impl UnwindSafe for StatId
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.