@@ -239,11 +239,11 @@ impl<'w> UnsafeWorldCell<'w> {
239
239
Some ( resource. id ( ) )
240
240
}
241
241
242
- /// Retrieves an [`UnsafeWorldCellEntityRef `] that exposes read and write operations for the given `entity`.
242
+ /// Retrieves an [`UnsafeEntityCell `] that exposes read and write operations for the given `entity`.
243
243
/// Similar to the [`UnsafeWorldCell`], you are in charge of making sure that no aliasing rules are violated.
244
- pub fn get_entity ( self , entity : Entity ) -> Option < UnsafeWorldCellEntityRef < ' w > > {
244
+ pub fn get_entity ( self , entity : Entity ) -> Option < UnsafeEntityCell < ' w > > {
245
245
let location = self . entities ( ) . get ( entity) ?;
246
- Some ( UnsafeWorldCellEntityRef :: new ( self , entity, location) )
246
+ Some ( UnsafeEntityCell :: new ( self , entity, location) )
247
247
}
248
248
249
249
/// Gets a reference to the resource of the given type if it exists
@@ -496,19 +496,19 @@ impl<'w> UnsafeWorldCell<'w> {
496
496
497
497
/// A interior-mutable reference to a particular [`Entity`] and all of its components
498
498
#[ derive( Copy , Clone ) ]
499
- pub struct UnsafeWorldCellEntityRef < ' w > {
499
+ pub struct UnsafeEntityCell < ' w > {
500
500
world : UnsafeWorldCell < ' w > ,
501
501
entity : Entity ,
502
502
location : EntityLocation ,
503
503
}
504
504
505
- impl < ' w > UnsafeWorldCellEntityRef < ' w > {
505
+ impl < ' w > UnsafeEntityCell < ' w > {
506
506
pub ( crate ) fn new (
507
507
world : UnsafeWorldCell < ' w > ,
508
508
entity : Entity ,
509
509
location : EntityLocation ,
510
510
) -> Self {
511
- UnsafeWorldCellEntityRef {
511
+ UnsafeEntityCell {
512
512
world,
513
513
entity,
514
514
location,
@@ -557,7 +557,7 @@ impl<'w> UnsafeWorldCellEntityRef<'w> {
557
557
558
558
/// # Safety
559
559
/// It is the callers responsibility to ensure that
560
- /// - the [`UnsafeWorldCellEntityRef `] has permission to access the component
560
+ /// - the [`UnsafeEntityCell `] has permission to access the component
561
561
/// - no other mutable references to the component exist at the same time
562
562
#[ inline]
563
563
pub unsafe fn get < T : Component > ( self ) -> Option < & ' w T > {
@@ -584,7 +584,7 @@ impl<'w> UnsafeWorldCellEntityRef<'w> {
584
584
///
585
585
/// # Safety
586
586
/// It is the callers responsibility to ensure that
587
- /// - the [`UnsafeWorldCellEntityRef `] has permission to access the component
587
+ /// - the [`UnsafeEntityCell `] has permission to access the component
588
588
/// - no other mutable references to the component exist at the same time
589
589
#[ inline]
590
590
pub unsafe fn get_change_ticks < T : Component > ( self ) -> Option < ComponentTicks > {
@@ -607,13 +607,13 @@ impl<'w> UnsafeWorldCellEntityRef<'w> {
607
607
/// Retrieves the change ticks for the given [`ComponentId`]. This can be useful for implementing change
608
608
/// detection in custom runtimes.
609
609
///
610
- /// **You should prefer to use the typed API [`UnsafeWorldCellEntityRef ::get_change_ticks`] where possible and only
610
+ /// **You should prefer to use the typed API [`UnsafeEntityCell ::get_change_ticks`] where possible and only
611
611
/// use this in cases where the actual component types are not known at
612
612
/// compile time.**
613
613
///
614
614
/// # Safety
615
615
/// It is the callers responsibility to ensure that
616
- /// - the [`UnsafeWorldCellEntityRef `] has permission to access the component
616
+ /// - the [`UnsafeEntityCell `] has permission to access the component
617
617
/// - no other mutable references to the component exist at the same time
618
618
#[ inline]
619
619
pub unsafe fn get_change_ticks_by_id (
@@ -638,7 +638,7 @@ impl<'w> UnsafeWorldCellEntityRef<'w> {
638
638
639
639
/// # Safety
640
640
/// It is the callers responsibility to ensure that
641
- /// - the [`UnsafeWorldCellEntityRef `] has permission to access the component mutably
641
+ /// - the [`UnsafeEntityCell `] has permission to access the component mutably
642
642
/// - no other references to the component exist at the same time
643
643
#[ inline]
644
644
pub unsafe fn get_mut < T : Component > ( self ) -> Option < Mut < ' w , T > > {
@@ -650,7 +650,7 @@ impl<'w> UnsafeWorldCellEntityRef<'w> {
650
650
651
651
/// # Safety
652
652
/// It is the callers responsibility to ensure that
653
- /// - the [`UnsafeWorldCellEntityRef `] has permission to access the component mutably
653
+ /// - the [`UnsafeEntityCell `] has permission to access the component mutably
654
654
/// - no other references to the component exist at the same time
655
655
#[ inline]
656
656
pub ( crate ) unsafe fn get_mut_using_ticks < T : Component > (
@@ -680,19 +680,19 @@ impl<'w> UnsafeWorldCellEntityRef<'w> {
680
680
}
681
681
}
682
682
683
- impl < ' w > UnsafeWorldCellEntityRef < ' w > {
683
+ impl < ' w > UnsafeEntityCell < ' w > {
684
684
/// Gets the component of the given [`ComponentId`] from the entity.
685
685
///
686
686
/// **You should prefer to use the typed API where possible and only
687
687
/// use this in cases where the actual component types are not known at
688
688
/// compile time.**
689
689
///
690
- /// Unlike [`UnsafeWorldCellEntityRef ::get`], this returns a raw pointer to the component,
690
+ /// Unlike [`UnsafeEntityCell ::get`], this returns a raw pointer to the component,
691
691
/// which is only valid while the `'w` borrow of the lifetime is active.
692
692
///
693
693
/// # Safety
694
694
/// It is the callers responsibility to ensure that
695
- /// - the [`UnsafeWorldCellEntityRef `] has permission to access the component
695
+ /// - the [`UnsafeEntityCell `] has permission to access the component
696
696
/// - no other mutable references to the component exist at the same time
697
697
#[ inline]
698
698
pub unsafe fn get_by_id ( self , component_id : ComponentId ) -> Option < Ptr < ' w > > {
@@ -712,12 +712,12 @@ impl<'w> UnsafeWorldCellEntityRef<'w> {
712
712
/// Retrieves a mutable untyped reference to the given `entity`'s [Component] of the given [`ComponentId`].
713
713
/// Returns [None] if the `entity` does not have a [Component] of the given type.
714
714
///
715
- /// **You should prefer to use the typed API [`UnsafeWorldCellEntityRef ::get_mut`] where possible and only
715
+ /// **You should prefer to use the typed API [`UnsafeEntityCell ::get_mut`] where possible and only
716
716
/// use this in cases where the actual types are not known at compile time.**
717
717
///
718
718
/// # Safety
719
719
/// It is the callers responsibility to ensure that
720
- /// - the [`UnsafeWorldCellEntityRef `] has permission to access the component mutably
720
+ /// - the [`UnsafeEntityCell `] has permission to access the component mutably
721
721
/// - no other references to the component exist at the same time
722
722
#[ inline]
723
723
pub unsafe fn get_mut_by_id ( self , component_id : ComponentId ) -> Option < MutUntyped < ' w > > {
0 commit comments