@@ -9,6 +9,7 @@ use crate::{
9
9
} ;
10
10
use std:: any:: TypeId ;
11
11
12
+ /// A read-only reference to a particular [`Entity`] and all of its components
12
13
pub struct EntityRef < ' w > {
13
14
world : & ' w World ,
14
15
entity : Entity ,
@@ -98,6 +99,7 @@ impl<'w> EntityRef<'w> {
98
99
}
99
100
}
100
101
102
+ /// A mutable reference to a particular [`Entity`] and all of its components
101
103
pub struct EntityMut < ' w > {
102
104
world : & ' w mut World ,
103
105
entity : Entity ,
@@ -464,6 +466,8 @@ impl<'w> EntityMut<'w> {
464
466
}
465
467
466
468
// TODO: move to Storages?
469
+ /// Get a raw pointer to a particular [`Component`] on a particular [`Entity`] in the provided [`World`].
470
+ ///
467
471
/// # Safety
468
472
/// `entity_location` must be within bounds of the given archetype and `entity` must exist inside
469
473
/// the archetype
@@ -494,6 +498,8 @@ unsafe fn get_component(
494
498
}
495
499
496
500
// TODO: move to Storages?
501
+ /// Get a raw pointer to the [`ComponentTicks`] of a particular [`Component`] on a particular [`Entity`] in the provided [World].
502
+ ///
497
503
/// # Safety
498
504
/// Caller must ensure that `component_id` is valid
499
505
#[ inline]
@@ -566,6 +572,8 @@ unsafe fn take_component(
566
572
}
567
573
}
568
574
575
+ /// Get a raw pointer to a particular [`Component`] by [`TypeId`] on a particular [`Entity`] in the provided [`World`].
576
+ ///
569
577
/// # Safety
570
578
/// `entity_location` must be within bounds of an archetype that exists.
571
579
unsafe fn get_component_with_type (
@@ -578,6 +586,8 @@ unsafe fn get_component_with_type(
578
586
get_component ( world, component_id, entity, location)
579
587
}
580
588
589
+ /// Get a raw pointer to the [`ComponentTicks`] of a particular [`Component`] by [`TypeId`] on a particular [`Entity`] in the provided [`World`].
590
+ ///
581
591
/// # Safety
582
592
/// `entity_location` must be within bounds of an archetype that exists.
583
593
pub ( crate ) unsafe fn get_component_and_ticks_with_type (
0 commit comments