{"action":"created","comment":{"url":"https://api.github.com/repos/slide-rs/specs/pulls/comments/240349782","pull_request_review_id":183360343,"id":240349782,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0MDM0OTc4Mg==","diff_hunk":"@@ -0,0 +1,201 @@\n+use super::*;\n+use crate::join::Join;\n+use hibitset::BitSetAll;\n+\n+impl<'e, T, D> Storage<'e, T, D>\n+where\n+    T: Component,\n+    D: DerefMut<Target = MaskedStorage<T>>,\n+{\n+    /// Returns an entry to the component associated to the entity.\n+    ///\n+    /// Behaves somewhat similarly to `std::collections::HashMap`'s entry api.\n+    ///\n+    /// ## Example\n+    ///\n+    /// ```rust\n+    /// # extern crate specs;\n+    /// # use specs::prelude::*;\n+    /// # struct Comp {\n+    /// #    field: u32\n+    /// # }\n+    /// # impl Component for Comp {\n+    /// #    type Storage = DenseVecStorage<Self>;\n+    /// # }\n+    /// # fn main() {\n+    /// # let mut world = World::new();\n+    /// # world.register::<Comp>();\n+    /// # let entity = world.create_entity().build();\n+    /// # let mut storage = world.write_storage::<Comp>();\n+    ///  if let Ok(entry) = storage.entry(entity) {\n+    ///      entry.or_insert(Comp { field: 55 });\n+    ///  }\n+    /// # }\n+    /// ```\n+    pub fn entry<'a>(&'a mut self, e: Entity) -> Result<StorageEntry<'a, 'e, T, D>, WrongGeneration>\n+    where\n+        'e: 'a,\n+    {\n+        if self.entities.is_alive(e) {\n+            unsafe {\n+                let entries = self.entries();\n+                let (_, mut value): (BitSetAll, _) = entries.open();\n+                Ok(Entries::get(&mut value, e.id()))\n+            }\n+        } else {\n+            let gen = self\n+                .entities\n+                .alloc\n+                .generation(e.id())\n+                .unwrap_or(Generation::one());\n+            Err(WrongGeneration {\n+                action: \"attempting to get an entry to a storage\",\n+                actual_gen: gen,\n+                entity: e,\n+            })\n+        }\n+    }\n+\n+    /// Returns a `Join`-able structure that yields all indices, returning\n+    /// `Entry` for all elements\n+    pub fn entries<'a>(&'a mut self) -> Entries<'a, 'e, T, D> {","path":"src/storage/entry.rs","position":117,"original_position":61,"commit_id":"ee4e0999a872b96d4019b8403c968a81f98effc5","original_commit_id":"9c1f54f5e9829d6acd28a6568d3c20defc298784","user":{"login":"jjedelsky","id":8687359,"node_id":"MDQ6VXNlcjg2ODczNTk=","avatar_url":"https://avatars3.githubusercontent.com/u/8687359?v=4","gravatar_id":"","url":"https://api.github.com/users/jjedelsky","html_url":"https://github.com/jjedelsky","followers_url":"https://api.github.com/users/jjedelsky/followers","following_url":"https://api.github.com/users/jjedelsky/following{/other_user}","gists_url":"https://api.github.com/users/jjedelsky/gists{/gist_id}","starred_url":"https://api.github.com/users/jjedelsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jjedelsky/subscriptions","organizations_url":"https://api.github.com/users/jjedelsky/orgs","repos_url":"https://api.github.com/users/jjedelsky/repos","events_url":"https://api.github.com/users/jjedelsky/events{/privacy}","received_events_url":"https://api.github.com/users/jjedelsky/received_events","type":"User","site_admin":false},"body":"Added","created_at":"2018-12-10T19:33:18Z","updated_at":"2018-12-10T19:33:18Z","html_url":"https://github.com/slide-rs/specs/pull/518#discussion_r240349782","pull_request_url":"https://api.github.com/repos/slide-rs/specs/pulls/518","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/slide-rs/specs/pulls/comments/240349782"},"html":{"href":"https://github.com/slide-rs/specs/pull/518#discussion_r240349782"},"pull_request":{"href":"https://api.github.com/repos/slide-rs/specs/pulls/518"}},"in_reply_to_id":240041777},"pull_request":{"url":"https://api.github.com/repos/slide-rs/specs/pulls/518","id":237118598,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM3MTE4NTk4","html_url":"https://github.com/slide-rs/specs/pull/518","diff_url":"https://github.com/slide-rs/specs/pull/518.diff","patch_url":"https://github.com/slide-rs/specs/pull/518.patch","issue_url":"https://api.github.com/repos/slide-rs/specs/issues/518","number":518,"state":"open","locked":false,"title":"Add Join-able entries API to Storage","user":{"login":"jjedelsky","id":8687359,"node_id":"MDQ6VXNlcjg2ODczNTk=","avatar_url":"https://avatars3.githubusercontent.com/u/8687359?v=4","gravatar_id":"","url":"https://api.github.com/users/jjedelsky","html_url":"https://github.com/jjedelsky","followers_url":"https://api.github.com/users/jjedelsky/followers","following_url":"https://api.github.com/users/jjedelsky/following{/other_user}","gists_url":"https://api.github.com/users/jjedelsky/gists{/gist_id}","starred_url":"https://api.github.com/users/jjedelsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jjedelsky/subscriptions","organizations_url":"https://api.github.com/users/jjedelsky/orgs","repos_url":"https://api.github.com/users/jjedelsky/repos","events_url":"https://api.github.com/users/jjedelsky/events{/privacy}","received_events_url":"https://api.github.com/users/jjedelsky/received_events","type":"User","site_admin":false},"body":"This makes it possible to read and insert component at same time inside join iteration.\r\n\r\n`Storage::entries` would likely need more docs, however I can not find any really minimal example.\r\n\r\n<!-- Reviewable:start -->\r\n---\r\nThis change is [<img src=\"https://reviewable.io/review_button.svg\" height=\"34\" align=\"absmiddle\" alt=\"Reviewable\"/>](https://reviewable.io/reviews/slide-rs/specs/518)\r\n<!-- Reviewable:end -->\r\n","created_at":"2018-12-09T09:18:31Z","updated_at":"2018-12-10T19:33:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bec8c2af0303cc7c892bdbc12468fcdc6989f4b7","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/slide-rs/specs/pulls/518/commits","review_comments_url":"https://api.github.com/repos/slide-rs/specs/pulls/518/comments","review_comment_url":"https://api.github.com/repos/slide-rs/specs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/slide-rs/specs/issues/518/comments","statuses_url":"https://api.github.com/repos/slide-rs/specs/statuses/ee4e0999a872b96d4019b8403c968a81f98effc5","head":{"label":"jjedelsky:entries","ref":"entries","sha":"ee4e0999a872b96d4019b8403c968a81f98effc5","user":{"login":"jjedelsky","id":8687359,"node_id":"MDQ6VXNlcjg2ODczNTk=","avatar_url":"https://avatars3.githubusercontent.com/u/8687359?v=4","gravatar_id":"","url":"https://api.github.com/users/jjedelsky","html_url":"https://github.com/jjedelsky","followers_url":"https://api.github.com/users/jjedelsky/followers","following_url":"https://api.github.com/users/jjedelsky/following{/other_user}","gists_url":"https://api.github.com/users/jjedelsky/gists{/gist_id}","starred_url":"https://api.github.com/users/jjedelsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jjedelsky/subscriptions","organizations_url":"https://api.github.com/users/jjedelsky/orgs","repos_url":"https://api.github.com/users/jjedelsky/repos","events_url":"https://api.github.com/users/jjedelsky/events{/privacy}","received_events_url":"https://api.github.com/users/jjedelsky/received_events","type":"User","site_admin":false},"repo":{"id":160935977,"node_id":"MDEwOlJlcG9zaXRvcnkxNjA5MzU5Nzc=","name":"specs","full_name":"jjedelsky/specs","private":false,"owner":{"login":"jjedelsky","id":8687359,"node_id":"MDQ6VXNlcjg2ODczNTk=","avatar_url":"https://avatars3.githubusercontent.com/u/8687359?v=4","gravatar_id":"","url":"https://api.github.com/users/jjedelsky","html_url":"https://github.com/jjedelsky","followers_url":"https://api.github.com/users/jjedelsky/followers","following_url":"https://api.github.com/users/jjedelsky/following{/other_user}","gists_url":"https://api.github.com/users/jjedelsky/gists{/gist_id}","starred_url":"https://api.github.com/users/jjedelsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jjedelsky/subscriptions","organizations_url":"https://api.github.com/users/jjedelsky/orgs","repos_url":"https://api.github.com/users/jjedelsky/repos","events_url":"https://api.github.com/users/jjedelsky/events{/privacy}","received_events_url":"https://api.github.com/users/jjedelsky/received_events","type":"User","site_admin":false},"html_url":"https://github.com/jjedelsky/specs","description":"Specs - Parallel ECS","fork":true,"url":"https://api.github.com/repos/jjedelsky/specs","forks_url":"https://api.github.com/repos/jjedelsky/specs/forks","keys_url":"https://api.github.com/repos/jjedelsky/specs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jjedelsky/specs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jjedelsky/specs/teams","hooks_url":"https://api.github.com/repos/jjedelsky/specs/hooks","issue_events_url":"https://api.github.com/repos/jjedelsky/specs/issues/events{/number}","events_url":"https://api.github.com/repos/jjedelsky/specs/events","assignees_url":"https://api.github.com/repos/jjedelsky/specs/assignees{/user}","branches_url":"https://api.github.com/repos/jjedelsky/specs/branches{/branch}","tags_url":"https://api.github.com/repos/jjedelsky/specs/tags","blobs_url":"https://api.github.com/repos/jjedelsky/specs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jjedelsky/specs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jjedelsky/specs/git/refs{/sha}","trees_url":"https://api.github.com/repos/jjedelsky/specs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jjedelsky/specs/statuses/{sha}","languages_url":"https://api.github.com/repos/jjedelsky/specs/languages","stargazers_url":"https://api.github.com/repos/jjedelsky/specs/stargazers","contributors_url":"https://api.github.com/repos/jjedelsky/specs/contributors","subscribers_url":"https://api.github.com/repos/jjedelsky/specs/subscribers","subscription_url":"https://api.github.com/repos/jjedelsky/specs/subscription","commits_url":"https://api.github.com/repos/jjedelsky/specs/commits{/sha}","git_commits_url":"https://api.github.com/repos/jjedelsky/specs/git/commits{/sha}","comments_url":"https://api.github.com/repos/jjedelsky/specs/comments{/number}","issue_comment_url":"https://api.github.com/repos/jjedelsky/specs/issues/comments{/number}","contents_url":"https://api.github.com/repos/jjedelsky/specs/contents/{+path}","compare_url":"https://api.github.com/repos/jjedelsky/specs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jjedelsky/specs/merges","archive_url":"https://api.github.com/repos/jjedelsky/specs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jjedelsky/specs/downloads","issues_url":"https://api.github.com/repos/jjedelsky/specs/issues{/number}","pulls_url":"https://api.github.com/repos/jjedelsky/specs/pulls{/number}","milestones_url":"https://api.github.com/repos/jjedelsky/specs/milestones{/number}","notifications_url":"https://api.github.com/repos/jjedelsky/specs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jjedelsky/specs/labels{/name}","releases_url":"https://api.github.com/repos/jjedelsky/specs/releases{/id}","deployments_url":"https://api.github.com/repos/jjedelsky/specs/deployments","created_at":"2018-12-08T12:15:47Z","updated_at":"2018-12-08T12:15:49Z","pushed_at":"2018-12-10T19:31:47Z","git_url":"git://github.com/jjedelsky/specs.git","ssh_url":"git@github.com:jjedelsky/specs.git","clone_url":"https://github.com/jjedelsky/specs.git","svn_url":"https://github.com/jjedelsky/specs","homepage":"https://slide-rs.github.io/","size":1709,"stargazers_count":0,"watchers_count":0,"language":"Rust","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"slide-rs:master","ref":"master","sha":"384b4d044df12cb778ba8fe42974c7b4dce07e53","user":{"login":"slide-rs","id":12649318,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyNjQ5MzE4","avatar_url":"https://avatars3.githubusercontent.com/u/12649318?v=4","gravatar_id":"","url":"https://api.github.com/users/slide-rs","html_url":"https://github.com/slide-rs","followers_url":"https://api.github.com/users/slide-rs/followers","following_url":"https://api.github.com/users/slide-rs/following{/other_user}","gists_url":"https://api.github.com/users/slide-rs/gists{/gist_id}","starred_url":"https://api.github.com/users/slide-rs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slide-rs/subscriptions","organizations_url":"https://api.github.com/users/slide-rs/orgs","repos_url":"https://api.github.com/users/slide-rs/repos","events_url":"https://api.github.com/users/slide-rs/events{/privacy}","received_events_url":"https://api.github.com/users/slide-rs/received_events","type":"Organization","site_admin":false},"repo":{"id":55565443,"node_id":"MDEwOlJlcG9zaXRvcnk1NTU2NTQ0Mw==","name":"specs","full_name":"slide-rs/specs","private":false,"owner":{"login":"slide-rs","id":12649318,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyNjQ5MzE4","avatar_url":"https://avatars3.githubusercontent.com/u/12649318?v=4","gravatar_id":"","url":"https://api.github.com/users/slide-rs","html_url":"https://github.com/slide-rs","followers_url":"https://api.github.com/users/slide-rs/followers","following_url":"https://api.github.com/users/slide-rs/following{/other_user}","gists_url":"https://api.github.com/users/slide-rs/gists{/gist_id}","starred_url":"https://api.github.com/users/slide-rs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slide-rs/subscriptions","organizations_url":"https://api.github.com/users/slide-rs/orgs","repos_url":"https://api.github.com/users/slide-rs/repos","events_url":"https://api.github.com/users/slide-rs/events{/privacy}","received_events_url":"https://api.github.com/users/slide-rs/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/slide-rs/specs","description":"Specs - Parallel ECS","fork":false,"url":"https://api.github.com/repos/slide-rs/specs","forks_url":"https://api.github.com/repos/slide-rs/specs/forks","keys_url":"https://api.github.com/repos/slide-rs/specs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/slide-rs/specs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/slide-rs/specs/teams","hooks_url":"https://api.github.com/repos/slide-rs/specs/hooks","issue_events_url":"https://api.github.com/repos/slide-rs/specs/issues/events{/number}","events_url":"https://api.github.com/repos/slide-rs/specs/events","assignees_url":"https://api.github.com/repos/slide-rs/specs/assignees{/user}","branches_url":"https://api.github.com/repos/slide-rs/specs/branches{/branch}","tags_url":"https://api.github.com/repos/slide-rs/specs/tags","blobs_url":"https://api.github.com/repos/slide-rs/specs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/slide-rs/specs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/slide-rs/specs/git/refs{/sha}","trees_url":"https://api.github.com/repos/slide-rs/specs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/slide-rs/specs/statuses/{sha}","languages_url":"https://api.github.com/repos/slide-rs/specs/languages","stargazers_url":"https://api.github.com/repos/slide-rs/specs/stargazers","contributors_url":"https://api.github.com/repos/slide-rs/specs/contributors","subscribers_url":"https://api.github.com/repos/slide-rs/specs/subscribers","subscription_url":"https://api.github.com/repos/slide-rs/specs/subscription","commits_url":"https://api.github.com/repos/slide-rs/specs/commits{/sha}","git_commits_url":"https://api.github.com/repos/slide-rs/specs/git/commits{/sha}","comments_url":"https://api.github.com/repos/slide-rs/specs/comments{/number}","issue_comment_url":"https://api.github.com/repos/slide-rs/specs/issues/comments{/number}","contents_url":"https://api.github.com/repos/slide-rs/specs/contents/{+path}","compare_url":"https://api.github.com/repos/slide-rs/specs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/slide-rs/specs/merges","archive_url":"https://api.github.com/repos/slide-rs/specs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/slide-rs/specs/downloads","issues_url":"https://api.github.com/repos/slide-rs/specs/issues{/number}","pulls_url":"https://api.github.com/repos/slide-rs/specs/pulls{/number}","milestones_url":"https://api.github.com/repos/slide-rs/specs/milestones{/number}","notifications_url":"https://api.github.com/repos/slide-rs/specs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/slide-rs/specs/labels{/name}","releases_url":"https://api.github.com/repos/slide-rs/specs/releases{/id}","deployments_url":"https://api.github.com/repos/slide-rs/specs/deployments","created_at":"2016-04-06T01:06:31Z","updated_at":"2018-12-10T18:11:16Z","pushed_at":"2018-12-10T19:31:55Z","git_url":"git://github.com/slide-rs/specs.git","ssh_url":"git@github.com:slide-rs/specs.git","clone_url":"https://github.com/slide-rs/specs.git","svn_url":"https://github.com/slide-rs/specs","homepage":"https://slide-rs.github.io/","size":1921,"stargazers_count":889,"watchers_count":889,"language":"Rust","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":98,"mirror_url":null,"archived":false,"open_issues_count":36,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":98,"open_issues":36,"watchers":889,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/slide-rs/specs/pulls/518"},"html":{"href":"https://github.com/slide-rs/specs/pull/518"},"issue":{"href":"https://api.github.com/repos/slide-rs/specs/issues/518"},"comments":{"href":"https://api.github.com/repos/slide-rs/specs/issues/518/comments"},"review_comments":{"href":"https://api.github.com/repos/slide-rs/specs/pulls/518/comments"},"review_comment":{"href":"https://api.github.com/repos/slide-rs/specs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/slide-rs/specs/pulls/518/commits"},"statuses":{"href":"https://api.github.com/repos/slide-rs/specs/statuses/ee4e0999a872b96d4019b8403c968a81f98effc5"}},"author_association":"NONE"}}
{"actor":{"display_login":"jjedelsky"}}