Struct shipyard::UniqueViewMut
source · pub struct UniqueViewMut<'a, T: Unique> { /* private fields */ }
Expand description
Exclusive view over a unique component storage.
Implementations§
source§impl<T: Unique> UniqueViewMut<'_, T>
impl<T: Unique> UniqueViewMut<'_, T>
sourcepub fn is_inserted(&self) -> bool
pub fn is_inserted(&self) -> bool
Returns true
if the component was inserted before the last clear_inserted
call.
sourcepub fn is_modified(&self) -> bool
pub fn is_modified(&self) -> bool
Returns true
if the component was modified since the last clear_modified
call.
sourcepub fn is_inserted_or_modified(&self) -> bool
pub fn is_inserted_or_modified(&self) -> bool
Returns true
if the component was inserted or modified since the last clear_inserted
or clear_modified
call.
sourcepub fn clear_inserted(self)
pub fn clear_inserted(self)
Removes the inserted flag on the component of this storage.
sourcepub fn clear_modified(self)
pub fn clear_modified(self)
Removes the modified flag on the component of this storage.
sourcepub fn clear_inserted_and_modified(self)
pub fn clear_inserted_and_modified(self)
Removes the inserted and modified flags on the component of this storage.
sourcepub fn override_last_insertion(
&mut self,
new_timestamp: TrackingTimestamp,
) -> TrackingTimestamp
pub fn override_last_insertion( &mut self, new_timestamp: TrackingTimestamp, ) -> TrackingTimestamp
Replaces the timestamp starting the tracking time window for insertions.
Tracking works based on a time window. From the last time the system ran (in workloads) or since the last clear.
Sometimes this automatic time window isn’t what you need. This can happen when you want to keep the same tracking information for multiple runs of the same system.
For example if you interpolate movement between frames, you might run an interpolation workload
multiple times but not change the World
during its execution.
In this case you want the same tracking information for all runs of this workload
which would have disappeared using the automatic window.
sourcepub fn override_last_modification(
&mut self,
new_timestamp: TrackingTimestamp,
) -> TrackingTimestamp
pub fn override_last_modification( &mut self, new_timestamp: TrackingTimestamp, ) -> TrackingTimestamp
Replaces the timestamp starting the tracking time window for modifications.
Tracking works based on a time window. From the last time the system ran (in workloads) or since the last clear.
Sometimes this automatic time window isn’t what you need. This can happen when you want to keep the same tracking information for multiple runs of the same system.
For example if you interpolate movement between frames, you might run an interpolation workload
multiple times but not change the World
during its execution.
In this case you want the same tracking information for all runs of this workload
which would have disappeared using the automatic window.
Trait Implementations§
source§impl<T: Unique> AsMut<T> for UniqueViewMut<'_, T>
impl<T: Unique> AsMut<T> for UniqueViewMut<'_, T>
source§impl<T: Unique> AsRef<T> for UniqueViewMut<'_, T>
impl<T: Unique> AsRef<T> for UniqueViewMut<'_, T>
source§impl<T: Send + Sync + Unique> Borrow for UniqueViewMut<'_, T>
impl<T: Send + Sync + Unique> Borrow for UniqueViewMut<'_, T>
type View<'a> = UniqueViewMut<'a, T>
source§fn borrow<'a>(
all_storages: &'a AllStorages,
all_borrow: Option<SharedBorrow<'a>>,
last_run: Option<TrackingTimestamp>,
current: TrackingTimestamp,
) -> Result<Self::View<'a>, GetStorage>
fn borrow<'a>( all_storages: &'a AllStorages, all_borrow: Option<SharedBorrow<'a>>, last_run: Option<TrackingTimestamp>, current: TrackingTimestamp, ) -> Result<Self::View<'a>, GetStorage>
source§impl<'a, T: Send + Sync + Unique> BorrowInfo for UniqueViewMut<'a, T>
impl<'a, T: Send + Sync + Unique> BorrowInfo for UniqueViewMut<'a, T>
source§fn borrow_info(info: &mut Vec<TypeInfo>)
fn borrow_info(info: &mut Vec<TypeInfo>)
source§fn enable_tracking(_: &mut Vec<fn(_: &AllStorages) -> Result<(), GetStorage>>)
fn enable_tracking(_: &mut Vec<fn(_: &AllStorages) -> Result<(), GetStorage>>)
World
where this storage is borrowed.source§impl<T: Unique> Deref for UniqueViewMut<'_, T>
impl<T: Unique> Deref for UniqueViewMut<'_, T>
Auto Trait Implementations§
impl<'a, T> Freeze for UniqueViewMut<'a, T>
impl<'a, T> RefUnwindSafe for UniqueViewMut<'a, T>where
T: RefUnwindSafe,
impl<'a, T> Send for UniqueViewMut<'a, T>where
T: Send,
impl<'a, T> Sync for UniqueViewMut<'a, T>where
T: Sync,
impl<'a, T> Unpin for UniqueViewMut<'a, T>
impl<'a, T> !UnwindSafe for UniqueViewMut<'a, T>
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
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> 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>
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>
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 more