@@ -5,13 +5,22 @@ use crate::{
5
5
} ;
6
6
use core:: panic:: Location ;
7
7
8
- /// Very similar to a normal [`Column`], but with the capacities and lengths cut out for performance reasons .
8
+ /// A type-erased contiguous container for data of a homogeneous type .
9
9
///
10
- /// This type is used by [`Table`], because all of the capacities and lengths of the [`Table`]'s columns must match.
10
+ /// Conceptually, a `ThinColumn` is very similar to a type-erased `Box<[T]>`.
11
+ /// It also stores the change detection ticks for its components, kept in two separate
12
+ /// contiguous buffers internally. An element shares its data across these buffers by using the
13
+ /// same index (i.e. the entity at row 3 has it's data at index 3 and its change detection ticks at index 3).
11
14
///
12
- /// Like many other low-level storage types, [ `ThinColumn`] has a limited and highly unsafe
15
+ /// Like many other low-level storage types, `ThinColumn` has a limited and highly unsafe
13
16
/// interface. It's highly advised to use higher level types and their safe abstractions
14
- /// instead of working directly with [`ThinColumn`].
17
+ /// instead of working directly with `ThinColumn`.
18
+ ///
19
+ /// For performance reasons, `ThinColumn` does not does not store it's capacity and length.
20
+ /// This type is used by [`Table`] and [`ComponentSparseSet`], because all of the capacities
21
+ /// and lengths of the owning storaage.
22
+ ///
23
+ /// [`ComponentSparseSet`]: crate::storage::ComponentSparseSet
15
24
#[ derive( Debug ) ]
16
25
pub struct ThinColumn {
17
26
pub ( super ) data : BlobArray ,
@@ -351,7 +360,7 @@ impl ThinColumn {
351
360
. map ( |changed_by| changed_by. as_slice ( len) )
352
361
}
353
362
354
- /// Fetches a read-only reference to the data at `row`. Unlike [`Column::get`] this does not
363
+ /// Fetches a read-only reference to the data at `row`. This does not
355
364
/// do any bounds checking.
356
365
///
357
366
/// # Safety
@@ -364,7 +373,7 @@ impl ThinColumn {
364
373
365
374
/// Fetches the calling location that last changed the value at `row`.
366
375
///
367
- /// Unlike [`Column::get_changed_by`] this function does not do any bounds checking.
376
+ /// This function does not do any bounds checking.
368
377
///
369
378
/// # Safety
370
379
/// `row` must be within the range `[0, self.len())`.
@@ -378,8 +387,8 @@ impl ThinColumn {
378
387
. map ( |changed_by| changed_by. get_unchecked ( row. index ( ) ) )
379
388
}
380
389
381
- /// Fetches the "added" change detection tick for the value at `row`. Unlike [`Column::get_added_tick`]
382
- /// this function does not do any bounds checking.
390
+ /// Fetches the "added" change detection tick for the value at `row`.
391
+ /// This function does not do any bounds checking.
383
392
///
384
393
/// # Safety
385
394
/// `row` must be within the range `[0, self.len())`.
@@ -388,8 +397,8 @@ impl ThinColumn {
388
397
self . added_ticks . get_unchecked ( row. index ( ) )
389
398
}
390
399
391
- /// Fetches the "changed" change detection tick for the value at `row`. Unlike [`Column::get_changed_tick`]
392
- /// this function does not do any bounds checking.
400
+ /// Fetches the "changed" change detection tick for the value at `row`
401
+ /// This function does not do any bounds checking.
393
402
///
394
403
/// # Safety
395
404
/// `row` must be within the range `[0, self.len())`.
@@ -398,8 +407,8 @@ impl ThinColumn {
398
407
self . changed_ticks . get_unchecked ( row. index ( ) )
399
408
}
400
409
401
- /// Fetches the change detection ticks for the value at `row`. Unlike [`Column::get_ticks`]
402
- /// this function does not do any bounds checking.
410
+ /// Fetches the change detection ticks for the value at `row`.
411
+ /// This function does not do any bounds checking.
403
412
///
404
413
/// # Safety
405
414
/// `row` must be within the range `[0, self.len())`.
0 commit comments