pub struct StatType<R: RegistryExt> {
pub key: Identifier,
stat_type_entry_ref: OnceLock<StatTypeEntryRef>,
_phantom: PhantomData<R>,
}Expand description
A structure that identifies a type of stat, using the
registry type [R] for using items from it to identify a particular stat.
Fields§
§key: IdentifierThe identifier that identifies this stat type uniquely.
stat_type_entry_ref: OnceLock<StatTypeEntryRef>§_phantom: PhantomData<R>Implementations§
Source§impl<R: RegistryExt> StatType<R>where
R::Entry: StatValueRegistryEntry,
impl<R: RegistryExt> StatType<R>where
R::Entry: StatValueRegistryEntry,
Sourcepub(crate) const fn new(key: Identifier) -> Self
pub(crate) const fn new(key: Identifier) -> Self
Creates a new StatType from a key and its display name.
Sourcepub const fn key(&self) -> &Identifier
pub const fn key(&self) -> &Identifier
Returns the identifying key of this stat type.
Sourcepub fn stat_type_entry_ref(&self) -> StatTypeEntryRef
pub fn stat_type_entry_ref(&self) -> StatTypeEntryRef
Gets the reference to the entry corresponding to their stat type.
§Panics
Panics if this stat type has not been registered with the StatTypeRegistry.
Auto Trait Implementations§
impl<R> !Freeze for StatType<R>
impl<R> !RefUnwindSafe for StatType<R>
impl<R> !UnwindSafe for StatType<R>
impl<R> Send for StatType<R>where
R: Send,
impl<R> Sync for StatType<R>where
R: Sync,
impl<R> Unpin for StatType<R>where
R: Unpin,
impl<R> UnsafeUnpin for StatType<R>
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreWraps this value in an
Arc<SyncMutex<>>