Skip to content

Commit 3dd5dc6

Browse files
Expose getter/setter for EntityGeneration (#21101)
While the EntityGeneration has an opaque underlying structure; it can still be useful to be able to access the actual value (for instance for networking) Do I need to add a Migration Guide?
1 parent 2b911e4 commit 3dd5dc6

File tree

1 file changed

+2
-2
lines changed
  • crates/bevy_ecs/src/entity

1 file changed

+2
-2
lines changed

crates/bevy_ecs/src/entity/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,15 +218,15 @@ impl EntityGeneration {
218218
/// Gets some bits that represent this value.
219219
/// The bits are opaque and should not be regarded as meaningful.
220220
#[inline(always)]
221-
const fn to_bits(self) -> u32 {
221+
pub const fn to_bits(self) -> u32 {
222222
self.0
223223
}
224224

225225
/// Reconstruct an [`EntityGeneration`] previously destructured with [`EntityGeneration::to_bits`].
226226
///
227227
/// Only useful when applied to results from `to_bits` in the same instance of an application.
228228
#[inline]
229-
const fn from_bits(bits: u32) -> Self {
229+
pub const fn from_bits(bits: u32) -> Self {
230230
Self(bits)
231231
}
232232

0 commit comments

Comments
 (0)