diff --git a/crates/bevy_ecs/src/bundle.rs b/crates/bevy_ecs/src/bundle.rs index d18d6bdd2a68a..fb7d61cbb959d 100644 --- a/crates/bevy_ecs/src/bundle.rs +++ b/crates/bevy_ecs/src/bundle.rs @@ -1473,6 +1473,21 @@ pub struct Bundles { } impl Bundles { + /// The total number of [`Bundle`] registered in [`Storages`]. + pub fn len(&self) -> usize { + self.bundle_infos.len() + } + + /// Returns true if no [`Bundle`] registered in [`Storages`]. + pub fn is_empty(&self) -> bool { + self.len() == 0 + } + + /// Iterate over [`BundleInfo`]. + pub fn iter(&self) -> impl Iterator { + self.bundle_infos.iter() + } + /// Gets the metadata associated with a specific type of bundle. /// Returns `None` if the bundle is not registered with the world. #[inline]