pub struct ViewMut<'a, T: Component, Track = <T as Component>::Tracking> { /* private fields */ }Expand description
Exclusive view over a component storage.
Implementations§
Source§impl<'v, T: Component, Track> ViewMut<'v, T, Track>
impl<'v, T: Component, Track> ViewMut<'v, T, Track>
pub fn as_optional(&mut self) -> Optional<&mut ViewMut<'v, T, Track>>
Source§impl<'a, T: Component, Track> ViewMut<'a, T, Track>where
Track: Tracking,
impl<'a, T: Component, Track> ViewMut<'a, T, Track>where
Track: Tracking,
Sourcepub fn as_view(&self) -> View<'_, T, Track>
pub fn as_view(&self) -> View<'_, T, Track>
Returns a View reborrowing from ViewMut.
There are often alternatives to calling this method, like reborrow.
One case where this method shines is for calling a system in another system.
sys_b cannot use a reference or it wouldn’t work as a system anymore.
fn sys_a(vm_compA: ViewMut<A>) {
// -- SNIP --
sys_b(vm_compA.as_view());
}
fn sys_b(v_compA: View<A>) {}
world.run(sys_a);
world.run(sys_b);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.
Sourcepub fn override_last_removal_or_deletion(
&mut self,
new_timestamp: TrackingTimestamp,
) -> TrackingTimestamp
pub fn override_last_removal_or_deletion( &mut self, new_timestamp: TrackingTimestamp, ) -> TrackingTimestamp
Replaces the timestamp starting the tracking time window for removals and deletions.
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<'a, T: Component> ViewMut<'a, T, Untracked>
impl<'a, T: Component> ViewMut<'a, T, Untracked>
Sourcepub fn new_for_custom_storage(
storage_id: StorageId,
all_storages: ARef<'a, &'a AllStorages>,
) -> Result<Self, CustomStorageView>
pub fn new_for_custom_storage( storage_id: StorageId, all_storages: ARef<'a, &'a AllStorages>, ) -> Result<Self, CustomStorageView>
Creates a new ViewMut for custom SparseSet storage.
use shipyard::{track, advanced::StorageId, Component, sparse_set::SparseSet, ViewMut, World};
struct ScriptingComponent(Vec<u8>);
impl Component for ScriptingComponent {
type Tracking = track::Untracked;
}
let world = World::new();
world.add_custom_storage(
StorageId::Custom(0),
SparseSet::<ScriptingComponent>::new_custom_storage(),
).unwrap();
let all_storages = world.all_storages().unwrap();
let scripting_storage =
ViewMut::<ScriptingComponent>::new_for_custom_storage(StorageId::Custom(0), all_storages)
.unwrap();Source§impl<'a, T: Component, Track> ViewMut<'a, T, Track>where
Track: Tracking,
impl<'a, T: Component, Track> ViewMut<'a, T, Track>where
Track: Tracking,
Sourcepub fn drain(&mut self) -> SparseSetDrain<'_, T> ⓘ
pub fn drain(&mut self) -> SparseSetDrain<'_, T> ⓘ
Creates a draining iterator that empties the storage and yields the removed items.
Sourcepub fn apply<R, F: FnOnce(&mut T, &T) -> R>(
&mut self,
a: EntityId,
b: EntityId,
f: F,
) -> R
pub fn apply<R, F: FnOnce(&mut T, &T) -> R>( &mut self, a: EntityId, b: EntityId, f: F, ) -> R
Applies the given function f to the entities a and b.
The two entities shouldn’t point to the same component.
§Panics
- MissingComponent - if one of the entity doesn’t have any component in the storage.
- IdenticalIds - if the two entities point to the same component.
Sourcepub fn apply_mut<R, F: FnOnce(&mut T, &mut T) -> R>(
&mut self,
a: EntityId,
b: EntityId,
f: F,
) -> R
pub fn apply_mut<R, F: FnOnce(&mut T, &mut T) -> R>( &mut self, a: EntityId, b: EntityId, f: F, ) -> R
Applies the given function f to the entities a and b.
The two entities shouldn’t point to the same component.
§Panics
- MissingComponent - if one of the entity doesn’t have any component in the storage.
- IdenticalIds - if the two entities point to the same component.
Source§impl<'v, Track, T: Component + Default> ViewMut<'v, T, Track>
impl<'v, Track, T: Component + Default> ViewMut<'v, T, Track>
Sourcepub fn get_or_default<'a>(
&'a mut self,
entity: EntityId,
) -> Option<<&'a mut ViewMut<'v, T, Track> as Get>::Out>
pub fn get_or_default<'a>( &'a mut self, entity: EntityId, ) -> Option<<&'a mut ViewMut<'v, T, Track> as Get>::Out>
Retrieve entity component.
If the entity doesn’t have the component, insert its Default value.
§Errors
Returns None when entity is dead and a component is already present for an entity with the same index.
Source§impl<'v, Track, T: Component> ViewMut<'v, T, Track>
impl<'v, Track, T: Component> ViewMut<'v, T, Track>
Sourcepub fn get_or_insert<'a>(
&'a mut self,
entity: EntityId,
component: T,
) -> Option<<&'a mut ViewMut<'v, T, Track> as Get>::Out>
pub fn get_or_insert<'a>( &'a mut self, entity: EntityId, component: T, ) -> Option<<&'a mut ViewMut<'v, T, Track> as Get>::Out>
Retrieve entity component.
If the entity doesn’t have the component, insert component.
§Errors
Returns None when entity is dead and a component is already present for an entity with the same index.
Sourcepub fn get_or_insert_with<'a, F: FnOnce() -> T>(
&'a mut self,
entity: EntityId,
f: F,
) -> Option<<&'a mut ViewMut<'v, T, Track> as Get>::Out>
pub fn get_or_insert_with<'a, F: FnOnce() -> T>( &'a mut self, entity: EntityId, f: F, ) -> Option<<&'a mut ViewMut<'v, T, Track> as Get>::Out>
Retrieve entity component.
If the entity doesn’t have the component, insert the result of f.
§Errors
Returns None when entity is dead and a component is already present for an entity with the same index.
Source§impl<Track, T: Component> ViewMut<'_, T, Track>where
Track: InsertionTracking,
impl<Track, T: Component> ViewMut<'_, T, Track>where
Track: InsertionTracking,
Sourcepub fn is_inserted(&self, entity: EntityId) -> bool
pub fn is_inserted(&self, entity: EntityId) -> bool
Inside a workload returns true if entity’s component was inserted since the last run of this system.
Outside workloads returns true if entity’s component was inserted since the last call to clear_all_inserted.
Returns false if entity does not have a component in this storage.
Sourcepub fn inserted(&self) -> Inserted<&Self>
pub fn inserted(&self) -> Inserted<&Self>
Wraps this view to be able to iterate inserted components.
Sourcepub fn inserted_mut(&mut self) -> Inserted<&mut Self>
pub fn inserted_mut(&mut self) -> Inserted<&mut Self>
Wraps this view to be able to iterate inserted components.
Sourcepub fn clear_all_inserted(self)
pub fn clear_all_inserted(self)
Removes the inserted flag on all components of this storage.
Source§impl<Track, T: Component> ViewMut<'_, T, Track>where
Track: ModificationTracking,
impl<Track, T: Component> ViewMut<'_, T, Track>where
Track: ModificationTracking,
Sourcepub fn is_modified(&self, entity: EntityId) -> bool
pub fn is_modified(&self, entity: EntityId) -> bool
Inside a workload returns true if entity’s component was modified since the last run of this system.
Outside workloads returns true if entity’s component was modified since the last call to clear_all_modified.
Returns false if entity does not have a component in this storage.
Sourcepub fn modified(&self) -> Modified<&Self>
pub fn modified(&self) -> Modified<&Self>
Wraps this view to be able to iterate modified components.
Sourcepub fn modified_mut(&mut self) -> Modified<&mut Self>
pub fn modified_mut(&mut self) -> Modified<&mut Self>
Wraps this view to be able to iterate modified components.
Sourcepub fn clear_all_modified(self)
pub fn clear_all_modified(self)
Removes the modified flag on all components of this storage.
Source§impl<Track, T: Component> ViewMut<'_, T, Track>where
Track: InsertionTracking + ModificationTracking,
impl<Track, T: Component> ViewMut<'_, T, Track>where
Track: InsertionTracking + ModificationTracking,
Sourcepub fn is_inserted_or_modified(&self, entity: EntityId) -> bool
pub fn is_inserted_or_modified(&self, entity: EntityId) -> bool
Inside a workload returns true if entity’s component was inserted or modified since the last run of this system.
Outside workloads returns true if entity’s component was inserted or modified since the last call to clear_all_inserted.
Returns false if entity does not have a component in this storage.
Sourcepub fn inserted_or_modified(&self) -> InsertedOrModified<&Self>
pub fn inserted_or_modified(&self) -> InsertedOrModified<&Self>
Wraps this view to be able to iterate inserted and modified components.
Sourcepub fn inserted_or_modified_mut(&mut self) -> InsertedOrModified<&mut Self>
pub fn inserted_or_modified_mut(&mut self) -> InsertedOrModified<&mut Self>
Wraps this view to be able to iterate inserted and modified components.
Sourcepub fn clear_all_inserted_and_modified(self)
pub fn clear_all_inserted_and_modified(self)
Removes the inserted and modified flags on all components of this storage.
Source§impl<Track, T: Component> ViewMut<'_, T, Track>where
Track: DeletionTracking,
impl<Track, T: Component> ViewMut<'_, T, Track>where
Track: DeletionTracking,
Sourcepub fn is_deleted(&self, entity: EntityId) -> bool
pub fn is_deleted(&self, entity: EntityId) -> bool
Inside a workload returns true if entity’s component was deleted since the last run of this system.
Outside workloads returns true if entity’s component was deleted since the last call to clear_all_deleted.
Returns false if entity does not have a component in this storage.
Source§impl<Track, T: Component> ViewMut<'_, T, Track>where
Track: RemovalTracking,
impl<Track, T: Component> ViewMut<'_, T, Track>where
Track: RemovalTracking,
Sourcepub fn is_removed(&self, entity: EntityId) -> bool
pub fn is_removed(&self, entity: EntityId) -> bool
Inside a workload returns true if entity’s component was removed since the last run of this system.
Outside workloads returns true if entity’s component was removed since the last call to clear_all_removed.
Returns false if entity does not have a component in this storage.
Source§impl<Track, T: Component> ViewMut<'_, T, Track>where
Track: RemovalOrDeletionTracking,
impl<Track, T: Component> ViewMut<'_, T, Track>where
Track: RemovalOrDeletionTracking,
Sourcepub fn is_removed_or_deleted(&self, entity: EntityId) -> bool
pub fn is_removed_or_deleted(&self, entity: EntityId) -> bool
Inside a workload returns true if entity’s component was deleted or removed since the last run of this system.
Outside workloads returns true if entity’s component was deleted or removed since the last clear call.
Returns false if entity does not have a component in this storage.
Sourcepub fn removed_or_deleted(&self) -> impl Iterator<Item = EntityId> + '_
pub fn removed_or_deleted(&self) -> impl Iterator<Item = EntityId> + '_
Returns the ids of removed or deleted components of a storage tracking removal and/or deletion.
Methods from Deref<Target = SparseSet<T>>§
Sourcepub fn contains(&self, entity: EntityId) -> bool
pub fn contains(&self, entity: EntityId) -> bool
Returns true if entity owns a component in this storage.
Sourcepub fn index_of(&self, entity: EntityId) -> Option<usize>
pub fn index_of(&self, entity: EntityId) -> Option<usize>
Returns the index of entity’s component in the dense and data vectors.
This index is only valid for this storage and until a modification happens.
Sourcepub unsafe fn index_of_unchecked(&self, entity: EntityId) -> usize
pub unsafe fn index_of_unchecked(&self, entity: EntityId) -> usize
Returns the index of entity’s component in the dense and data vectors.
This index is only valid for this storage and until a modification happens.
§Safety
entity has to own a component of this type.
The index is only valid until a modification occurs in the storage.
Sourcepub fn on_insertion(
&mut self,
f: impl FnMut(EntityId, &T) + Send + Sync + 'static,
)
pub fn on_insertion( &mut self, f: impl FnMut(EntityId, &T) + Send + Sync + 'static, )
Sets the on insertion callback.
Sourcepub fn take_on_insertion(
&mut self,
) -> Option<Box<dyn FnMut(EntityId, &T) + Send + Sync + 'static>>
pub fn take_on_insertion( &mut self, ) -> Option<Box<dyn FnMut(EntityId, &T) + Send + Sync + 'static>>
Remove the on insertion callback.
Sourcepub fn on_removal(
&mut self,
f: impl FnMut(EntityId, &T) + Send + Sync + 'static,
)
pub fn on_removal( &mut self, f: impl FnMut(EntityId, &T) + Send + Sync + 'static, )
Sets the on removal and deletion callback.
Sourcepub fn take_on_removal(
&mut self,
) -> Option<Box<dyn FnMut(EntityId, &T) + Send + Sync + 'static>>
pub fn take_on_removal( &mut self, ) -> Option<Box<dyn FnMut(EntityId, &T) + Send + Sync + 'static>>
Remove the on removal and deletion callback.
Sourcepub fn insert(
&mut self,
entity: EntityId,
value: T,
current: TrackingTimestamp,
) -> InsertionResult<T>
pub fn insert( &mut self, entity: EntityId, value: T, current: TrackingTimestamp, ) -> InsertionResult<T>
Inserts value in the SparseSet.
§Tracking
In case entity had a component of this type, the new component will be considered modified.
In all other cases it’ll be considered inserted.
Sourcepub fn clear_all_deleted(&mut self)
pub fn clear_all_deleted(&mut self)
Clear all deletion tracking data.
Sourcepub fn clear_all_deleted_older_than_timestamp(
&mut self,
timestamp: TrackingTimestamp,
)
pub fn clear_all_deleted_older_than_timestamp( &mut self, timestamp: TrackingTimestamp, )
Clear all deletion tracking data older than some timestamp.
Sourcepub fn clear_all_removed(&mut self)
pub fn clear_all_removed(&mut self)
Clear all removal tracking data.
Sourcepub fn clear_all_removed_older_than_timestamp(
&mut self,
timestamp: TrackingTimestamp,
)
pub fn clear_all_removed_older_than_timestamp( &mut self, timestamp: TrackingTimestamp, )
Clear all removal tracking data older than some timestamp.
Sourcepub fn clear_all_removed_and_deleted(&mut self)
pub fn clear_all_removed_and_deleted(&mut self)
Clear all deletion and removal tracking data.
Sourcepub fn clear_all_removed_and_deleted_older_than_timestamp(
&mut self,
timestamp: TrackingTimestamp,
)
pub fn clear_all_removed_and_deleted_older_than_timestamp( &mut self, timestamp: TrackingTimestamp, )
Clear all deletion and removal tracking data older than some timestamp.
Sourcepub fn track_insertion(&mut self) -> &mut SparseSet<T>
pub fn track_insertion(&mut self) -> &mut SparseSet<T>
Make this storage track insertions.
Sourcepub fn track_modification(&mut self) -> &mut SparseSet<T>
pub fn track_modification(&mut self) -> &mut SparseSet<T>
Make this storage track modification.
Sourcepub fn track_deletion(&mut self) -> &mut SparseSet<T>
pub fn track_deletion(&mut self) -> &mut SparseSet<T>
Make this storage track deletions.
Sourcepub fn track_removal(&mut self) -> &mut SparseSet<T>
pub fn track_removal(&mut self) -> &mut SparseSet<T>
Make this storage track removals.
Sourcepub fn track_all(&mut self)
pub fn track_all(&mut self)
Make this storage track insertions, modifications, deletions and removals.
Sourcepub fn is_tracking_insertion(&self) -> bool
pub fn is_tracking_insertion(&self) -> bool
Returns true if the storage tracks insertion.
Sourcepub fn is_tracking_modification(&self) -> bool
pub fn is_tracking_modification(&self) -> bool
Returns true if the storage tracks modification.
Sourcepub fn is_tracking_deletion(&self) -> bool
pub fn is_tracking_deletion(&self) -> bool
Returns true if the storage tracks deletion.
Sourcepub fn is_tracking_removal(&self) -> bool
pub fn is_tracking_removal(&self) -> bool
Returns true if the storage tracks removal.
Sourcepub fn is_tracking_any(&self) -> bool
pub fn is_tracking_any(&self) -> bool
Returns true if the storage tracks insertion, deletion or removal.
Sourcepub fn reserve(&mut self, additional: usize)
pub fn reserve(&mut self, additional: usize)
Reserves memory for at least additional components. Adding components can still allocate though.
Sourcepub fn sort_unstable_by<F: FnMut(&T, &T) -> Ordering>(&mut self, compare: F)
pub fn sort_unstable_by<F: FnMut(&T, &T) -> Ordering>(&mut self, compare: F)
Sorts the SparseSet with a comparator function, but may not preserve the order of equal elements.
Sourcepub fn sort_unstable(&mut self)
pub fn sort_unstable(&mut self)
Sorts the SparseSet, but may not preserve the order of equal elements.
Sourcepub fn register_clone(&mut self)
pub fn register_clone(&mut self)
Registers the function to clone this component.
Trait Implementations§
Source§impl<T: Component, TRACK> AddComponent<Option<T>> for &mut ViewMut<'_, T, TRACK>
impl<T: Component, TRACK> AddComponent<Option<T>> for &mut ViewMut<'_, T, TRACK>
Source§fn add_component_unchecked(&mut self, entity: EntityId, component: Option<T>)
fn add_component_unchecked(&mut self, entity: EntityId, component: Option<T>)
component to entity, multiple components can be added at the same time using a tuple.This function does not check
entity is alive. It’s possible to add components to removed entities.Use
Entities::add_component if you’re unsure. Read moreSource§impl<T: Component, TRACK> AddComponent<Option<T>> for ViewMut<'_, T, TRACK>
impl<T: Component, TRACK> AddComponent<Option<T>> for ViewMut<'_, T, TRACK>
Source§fn add_component_unchecked(&mut self, entity: EntityId, component: Option<T>)
fn add_component_unchecked(&mut self, entity: EntityId, component: Option<T>)
component to entity, multiple components can be added at the same time using a tuple.This function does not check
entity is alive. It’s possible to add components to removed entities.Use
Entities::add_component if you’re unsure. Read moreSource§impl<T: Component, TRACK> AddComponent<T> for &mut ViewMut<'_, T, TRACK>
impl<T: Component, TRACK> AddComponent<T> for &mut ViewMut<'_, T, TRACK>
Source§fn add_component_unchecked(&mut self, entity: EntityId, component: T)
fn add_component_unchecked(&mut self, entity: EntityId, component: T)
component to entity, multiple components can be added at the same time using a tuple.This function does not check
entity is alive. It’s possible to add components to removed entities.Use
Entities::add_component if you’re unsure. Read moreSource§impl<T: Component, TRACK> AddComponent<T> for ViewMut<'_, T, TRACK>
impl<T: Component, TRACK> AddComponent<T> for ViewMut<'_, T, TRACK>
Source§fn add_component_unchecked(&mut self, entity: EntityId, component: T)
fn add_component_unchecked(&mut self, entity: EntityId, component: T)
component to entity, multiple components can be added at the same time using a tuple.This function does not check
entity is alive. It’s possible to add components to removed entities.Use
Entities::add_component if you’re unsure. Read moreSource§impl<T: Component + PartialEq> AddDistinctComponent for &mut ViewMut<'_, T>
impl<T: Component + PartialEq> AddDistinctComponent for &mut ViewMut<'_, T>
type Component = T
Source§fn add_distinct_component_unchecked(
&mut self,
entity: EntityId,
component: Self::Component,
) -> bool
fn add_distinct_component_unchecked( &mut self, entity: EntityId, component: Self::Component, ) -> bool
component to entity, multiple components can be added at the same time using a tuple.If the entity already has this component, it won’t be replaced. Very useful if you want accurate modification tracking.
This function does not check
entity is alive. It’s possible to add components to removed entities.Use
Entities::add_component if you’re unsure. Read moreSource§impl<T: Component + PartialEq> AddDistinctComponent for ViewMut<'_, T>
impl<T: Component + PartialEq> AddDistinctComponent for ViewMut<'_, T>
type Component = T
Source§fn add_distinct_component_unchecked(
&mut self,
entity: EntityId,
component: Self::Component,
) -> bool
fn add_distinct_component_unchecked( &mut self, entity: EntityId, component: Self::Component, ) -> bool
component to entity, multiple components can be added at the same time using a tuple.If the entity already has this component, it won’t be replaced. Very useful if you want accurate modification tracking.
This function does not check
entity is alive. It’s possible to add components to removed entities.Use
Entities::add_component if you’re unsure. Read moreSource§impl<T: Send + Sync + Component, Track> Borrow for ViewMut<'_, T, Track>where
Track: Tracking,
impl<T: Send + Sync + Component, Track> Borrow for ViewMut<'_, T, Track>where
Track: Tracking,
type View<'a> = ViewMut<'a, T, Track>
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 + Component, Track> BorrowInfo for ViewMut<'a, T, Track>where
Track: Tracking,
impl<'a, T: Send + Sync + Component, Track> BorrowInfo for ViewMut<'a, T, Track>where
Track: Tracking,
Source§fn borrow_info(info: &mut Vec<TypeInfo>)
fn borrow_info(info: &mut Vec<TypeInfo>)
Source§fn enable_tracking(
enable_tracking_fn: &mut Vec<fn(&AllStorages) -> Result<(), GetStorage>>,
)
fn enable_tracking( enable_tracking_fn: &mut Vec<fn(&AllStorages) -> Result<(), GetStorage>>, )
World where this storage is borrowed.Source§impl<T: Component, TRACK> BulkReserve for &mut ViewMut<'_, T, TRACK>
impl<T: Component, TRACK> BulkReserve for &mut ViewMut<'_, T, TRACK>
Source§fn bulk_reserve(&mut self, new_entities: &[EntityId])
fn bulk_reserve(&mut self, new_entities: &[EntityId])
new_entities.Source§impl<T: Component, TRACK> BulkReserve for ViewMut<'_, T, TRACK>
impl<T: Component, TRACK> BulkReserve for ViewMut<'_, T, TRACK>
Source§fn bulk_reserve(&mut self, new_entities: &[EntityId])
fn bulk_reserve(&mut self, new_entities: &[EntityId])
new_entities.Source§impl<'view, 'de: 'view, T, Track: Tracking> Deserialize<'de> for ViewMut<'view, T, Track>where
T: DeserializeOwned + Component,
Available on crate feature serde1 only.
impl<'view, 'de: 'view, T, Track: Tracking> Deserialize<'de> for ViewMut<'view, T, Track>where
T: DeserializeOwned + Component,
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>,
Source§impl<'tmp, 'v: 'tmp, T: Component, Track: Tracking> IntoShiperator for &'tmp ViewMut<'v, T, Track>
impl<'tmp, 'v: 'tmp, T: Component, Track: Tracking> IntoShiperator for &'tmp ViewMut<'v, T, Track>
type Shiperator = FullRawWindow<'tmp, T>
Source§fn into_shiperator(
self,
_storage_ids: &mut ShipHashSet<StorageId>,
) -> (Self::Shiperator, usize, RawEntityIdAccess)
fn into_shiperator( self, _storage_ids: &mut ShipHashSet<StorageId>, ) -> (Self::Shiperator, usize, RawEntityIdAccess)
RawEntityIdAccess.Source§fn can_captain() -> bool
fn can_captain() -> bool
true if the Shiperator can be a captain.Source§fn can_sailor() -> bool
fn can_sailor() -> bool
true if the Shiperator can be a sailor.Source§impl<'tmp, 'v: 'tmp, T: Component, Track> IntoShiperator for &'tmp mut ViewMut<'v, T, Track>
impl<'tmp, 'v: 'tmp, T: Component, Track> IntoShiperator for &'tmp mut ViewMut<'v, T, Track>
type Shiperator = FullRawWindowMut<'tmp, T, Track>
Source§fn into_shiperator(
self,
_storage_ids: &mut ShipHashSet<StorageId>,
) -> (Self::Shiperator, usize, RawEntityIdAccess)
fn into_shiperator( self, _storage_ids: &mut ShipHashSet<StorageId>, ) -> (Self::Shiperator, usize, RawEntityIdAccess)
RawEntityIdAccess.Source§fn can_captain() -> bool
fn can_captain() -> bool
true if the Shiperator can be a captain.Source§fn can_sailor() -> bool
fn can_sailor() -> bool
true if the Shiperator can be a sailor.Auto Trait Implementations§
impl<'a, T, Track> Freeze for ViewMut<'a, T, Track>
impl<'a, T, Track = <T as Component>::Tracking> !RefUnwindSafe for ViewMut<'a, T, Track>
impl<'a, T, Track> Send for ViewMut<'a, T, Track>
impl<'a, T, Track> Sync for ViewMut<'a, T, Track>
impl<'a, T, Track> Unpin for ViewMut<'a, T, Track>where
Track: Unpin,
impl<'a, T, Track = <T as Component>::Tracking> !UnwindSafe for ViewMut<'a, T, Track>
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