Skip to content

Commit

Permalink
Docs, and a note to my future self
Browse files Browse the repository at this point in the history
  • Loading branch information
recatek committed Jan 11, 2025
1 parent 0367b52 commit a05c1f7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,13 @@ pub trait ArchetypeHas<C>: Archetype {
fn resolve_borrow_component_mut<'a>(borrow: &'a Self::Borrow<'a>) -> RefMut<'a, C>;
}

/// A `View` is a reference to a specific entity's components within an archetype.
// NOTE: There's no point in trying to make a View/ViewMut split because each column is in a
// RefCell anyway, so you can't make non-mut references to them without borrowing, and Borrow
// already exists for that. Borrow also does it better, since it doesn't fully borrow each slice.

/// A `View` is a mutable reference to a specific entity's components within an archetype. It
/// allows direct access to all of a specific entity's components, but exclusively borrows the
/// entire archetype in the process (for more flexibility here at a runtime cost, see [`Borrow`]).
///
/// This can be used in generic functions to access components from entity handles.
///
Expand Down

0 comments on commit a05c1f7

Please sign in to comment.