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.
Source§impl<T: Unique + Clone> UniqueViewMut<'_, T>
impl<T: Unique + Clone> UniqueViewMut<'_, T>
Sourcepub fn register_clone(&mut self)
pub fn register_clone(&mut self)
Registers the function to clone this unique component.
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>
Source§impl<T: Unique> DerefMut for UniqueViewMut<'_, T>
impl<T: Unique> DerefMut for UniqueViewMut<'_, T>
Source§impl<'view, 'de: 'view, T> Deserialize<'de> for UniqueViewMut<'view, T>where
T: DeserializeOwned + Unique,
Available on crate feature serde1 only.
impl<'view, 'de: 'view, T> Deserialize<'de> for UniqueViewMut<'view, T>where
T: DeserializeOwned + Unique,
serde1 only.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>,
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