fn mark<'m>(
        &mut self,
        entity: Entity,
        storage: &'m mut WriteStorage<M>,
    ) -> Option<(&'m M, bool)> {
        let new = if let Ok(entry) = storage.entry(entity) {
            let mut new = false;
            let _marker = entry.or_insert_with(|| {
                new = true;
                self.allocate(entity, None)
            });

            new
        } else {
            return None
        };
        Some((storage.get(entity).unwrap(), new))
    }
/// Create new unique marker `M` and attach it to entity.
/// Or get old marker if this entity is already marked.
/// If entity is dead then this will return `None`.
Create new unique marker `M` and attach it to entity.
Or get old marker if this entity is already marked.
If entity is dead then this will return `None`.
Create new unique marker ` M ` and attach it to entity . Or get old marker if this entity is already marked . If entity is dead then this will return ` None ` .
fn mark<'m>(
        &mut self,
        entity: Entity,
        storage: &'m mut WriteStorage<M>,
    ) -> Option<(&'m M, bool)> {
        let new = if let Ok(entry) = storage.entry(entity) {
            let mut new = false;
            let _marker = entry.or_insert_with(|| {
                new = true;
                self.allocate(entity, None)
            });
            new
        } else {
            return None
        };
        Some((storage.get(entity).unwrap(), new))
    }
fn mark < ' m > ( & mut self , entity : Entity , storage : & ' m mut WriteStorage < M > , ) -> Option < ( & ' m M , bool ) > { let new = if let Ok ( entry ) = storage . entry ( entity ) { let mut new = false ; let _marker = entry . or_insert_with ( | | { new = true ; self . allocate ( entity , None ) } ) ; new } else { return None } ; Some ( ( storage . get ( entity ) . unwrap ( ) , new ) ) }
Create new unique marker `M` and attach it to entity.
Create new unique marker ` M ` and attach it to entity .
&mut self
entity
Entity
storage
&'m mut WriteStorage<M>