From d3e9ecbb8c523c9632720463dea6b46393e840bf Mon Sep 17 00:00:00 2001 From: Christian Hughes <9044780+ItsDoot@users.noreply.github.com> Date: Sun, 17 Nov 2024 03:47:33 -0600 Subject: [PATCH] Add missing exports in bevy_ecs (#16415) # Objective Seemed to have missed the export of `DynamicComponentFetch` from #15593. `TryFromFilteredError` which is returned by `impl TryFrom for EntityRef/Mut` also seemed to have been missing. ## Solution Export both of them. --- crates/bevy_ecs/src/world/entity_ref.rs | 8 +++++++- crates/bevy_ecs/src/world/mod.rs | 4 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/crates/bevy_ecs/src/world/entity_ref.rs b/crates/bevy_ecs/src/world/entity_ref.rs index 8917b924b5..b5e66974d8 100644 --- a/crates/bevy_ecs/src/world/entity_ref.rs +++ b/crates/bevy_ecs/src/world/entity_ref.rs @@ -2802,13 +2802,19 @@ impl<'a> From<&'a mut EntityWorldMut<'_>> for FilteredEntityMut<'a> { } } +/// Error type returned by [`TryFrom`] conversions from filtered entity types +/// ([`FilteredEntityRef`]/[`FilteredEntityMut`]) to full-access entity types +/// ([`EntityRef`]/[`EntityMut`]). #[derive(Error, Display, Debug)] pub enum TryFromFilteredError { + /// Error indicating that the filtered entity does not have read access to + /// all components. #[display( "Conversion failed, filtered entity ref does not have read access to all components" )] MissingReadAllAccess, - + /// Error indicating that the filtered entity does not have write access to + /// all components. #[display( "Conversion failed, filtered entity ref does not have write access to all components" )] diff --git a/crates/bevy_ecs/src/world/mod.rs b/crates/bevy_ecs/src/world/mod.rs index d50f8f421c..eae555a0d5 100644 --- a/crates/bevy_ecs/src/world/mod.rs +++ b/crates/bevy_ecs/src/world/mod.rs @@ -22,8 +22,8 @@ pub use component_constants::*; pub use deferred_world::DeferredWorld; pub use entity_fetch::WorldEntityFetch; pub use entity_ref::{ - EntityMut, EntityMutExcept, EntityRef, EntityRefExcept, EntityWorldMut, Entry, - FilteredEntityMut, FilteredEntityRef, OccupiedEntry, VacantEntry, + DynamicComponentFetch, EntityMut, EntityMutExcept, EntityRef, EntityRefExcept, EntityWorldMut, + Entry, FilteredEntityMut, FilteredEntityRef, OccupiedEntry, TryFromFilteredError, VacantEntry, }; pub use filtered_resource::*; pub use identifier::WorldId;