pub fn with<C: 'static>(mut self) -> Self {
        let type_id = TypeId::of::<C>();
        if let hash_map::Entry::Vacant(e) = self.layout.type_infos.entry(type_id) {
            let drop_func = |p: *mut u8| unsafe { ptr::drop_in_place(p as *mut C) };
            e.insert(TypeInfo {
                size: mem::size_of::<C>(),
                needs_drop: mem::needs_drop::<C>(),
                drop_func,
            });
        }

        self.type_ids.insert(type_id);
        self
    }
/// Adds a component type to the archetype layout. Adding already present component type will have no effect.
Adds a component type to the archetype layout. Adding already present component type will have no effect.
Adds a component type to the archetype layout . Adding already present component type will have no effect .
pub fn with<C: 'static>(mut self) -> Self {
        let type_id = TypeId::of::<C>();
        if let hash_map::Entry::Vacant(e) = self.layout.type_infos.entry(type_id) {
            let drop_func = |p: *mut u8| unsafe { ptr::drop_in_place(p as *mut C) };
            e.insert(TypeInfo {
                size: mem::size_of::<C>(),
                needs_drop: mem::needs_drop::<C>(),
                drop_func,
            });
        }
        self.type_ids.insert(type_id);
        self
    }
pub fn with < C : ' static > ( mut self ) -> Self { let type_id = TypeId :: of :: < C > ( ) ; if let hash_map :: Entry :: Vacant ( e ) = self . layout . type_infos . entry ( type_id ) { let drop_func = | p : * mut u8 | unsafe { ptr :: drop_in_place ( p as * mut C ) } ; e . insert ( TypeInfo { size : mem :: size_of :: < C > ( ) , needs_drop : mem :: needs_drop :: < C > ( ) , drop_func , } ) ; } self . type_ids . insert ( type_id ) ; self }
Adds a component type to the archetype layout.
Adds a component type to the archetype layout .
mut self
mut self