pub struct AdvancementProgressMap {
map: FxHashMap<AdvancementRef, usize>,
order: Vec<(AdvancementRef, AdvancementProgress)>,
}Expand description
represent a map of all progress made for advancement of a specific player
Fields§
§map: FxHashMap<AdvancementRef, usize>A map of all advancement progress for the player.
order: Vec<(AdvancementRef, AdvancementProgress)>Implementations§
Source§impl AdvancementProgressMap
impl AdvancementProgressMap
Sourcepub fn get_mut_or_start_progress(
&mut self,
advancement: AdvancementRef,
) -> &mut AdvancementProgress
pub fn get_mut_or_start_progress( &mut self, advancement: AdvancementRef, ) -> &mut AdvancementProgress
Gets a mutable reference to the current progress for a given advancement. Creates the state entry if missing.
Sourcepub fn start_progress(
&mut self,
advancement: AdvancementRef,
progress: AdvancementProgress,
)
pub fn start_progress( &mut self, advancement: AdvancementRef, progress: AdvancementProgress, )
Replaces the progress of an advancement with persisted state.
Sourcepub fn insert(
&mut self,
advancement: AdvancementRef,
progress: AdvancementProgress,
)
pub fn insert( &mut self, advancement: AdvancementRef, progress: AdvancementProgress, )
insert a new advancement to the progress map
Sourcepub fn has_progress(&self, advancement: AdvancementRef) -> bool
pub fn has_progress(&self, advancement: AdvancementRef) -> bool
return whether the advancement has a progress instance
Sourcepub fn get_progress(
&self,
advancement: AdvancementRef,
) -> Option<&AdvancementProgress>
pub fn get_progress( &self, advancement: AdvancementRef, ) -> Option<&AdvancementProgress>
return the progress of a specific advancement
Sourcepub fn iter(
&self,
) -> impl Iterator<Item = &(AdvancementRef, AdvancementProgress)>
pub fn iter( &self, ) -> impl Iterator<Item = &(AdvancementRef, AdvancementProgress)>
return an iterator over all the progress made using the order of insertion
Trait Implementations§
Source§impl Clone for AdvancementProgressMap
impl Clone for AdvancementProgressMap
Source§impl Debug for AdvancementProgressMap
impl Debug for AdvancementProgressMap
Auto Trait Implementations§
impl !RefUnwindSafe for AdvancementProgressMap
impl !UnwindSafe for AdvancementProgressMap
impl Freeze for AdvancementProgressMap
impl Send for AdvancementProgressMap
impl Sync for AdvancementProgressMap
impl Unpin for AdvancementProgressMap
impl UnsafeUnpin for AdvancementProgressMap
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,
§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<>>