pub struct ArchetypeLayout { /* private fields */ }Expand description
Sorted set of TypeIds identifying which components an archetype holds.
Two layouts with the same type set (regardless of input order) are equal and hash the same.
Implementations§
Source§impl ArchetypeLayout
impl ArchetypeLayout
Sourcepub fn from_type_ids(ids: &[TypeId]) -> Self
pub fn from_type_ids(ids: &[TypeId]) -> Self
Create a layout from an unsorted, possibly-duplicate slice of type IDs.
Sourcepub fn empty() -> Self
pub fn empty() -> Self
Create an empty layout (the “void” archetype for entities with no components).
Sourcepub fn with_added(&self, id: TypeId) -> Self
pub fn with_added(&self, id: TypeId) -> Self
Return a new layout with id added (no-op if already present).
Sourcepub fn with_removed(&self, id: TypeId) -> Self
pub fn with_removed(&self, id: TypeId) -> Self
Return a new layout with id removed (no-op if absent).
Trait Implementations§
Source§impl Clone for ArchetypeLayout
impl Clone for ArchetypeLayout
Source§impl Debug for ArchetypeLayout
impl Debug for ArchetypeLayout
impl Eq for ArchetypeLayout
Source§impl Hash for ArchetypeLayout
impl Hash for ArchetypeLayout
Source§impl PartialEq for ArchetypeLayout
impl PartialEq for ArchetypeLayout
impl StructuralPartialEq for ArchetypeLayout
Auto Trait Implementations§
impl Freeze for ArchetypeLayout
impl RefUnwindSafe for ArchetypeLayout
impl Send for ArchetypeLayout
impl Sync for ArchetypeLayout
impl Unpin for ArchetypeLayout
impl UnsafeUnpin for ArchetypeLayout
impl UnwindSafe for ArchetypeLayout
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more