{"action":"created","comment":{"url":"https://api.github.com/repos/rtbo/rust-xcb/pulls/comments/86242846","pull_request_review_id":6910643,"id":86242846,"diff_hunk":"@@ -1186,6 +1187,20 @@ def _rs_union_accessor(typeobj, field):\n         _r('}')\n \n \n+    elif field.type.is_container:\n+        _r('pub fn %s(&self) -> %s {', field.rs_field_name, field.rs_field_type)\n+        with _r.indent_block():\n+            _r('unsafe {')\n+            with _r.indent_block():\n+                if hasattr(field.type, 'struct_ptr') and field.type.struct_ptr:\n+                    _r('std::mem::transmute(self)')\n+                else:","path":"rs_client.py","position":19,"original_position":19,"commit_id":"d64c20773d684f4b80a6eb8c62c01ef86419cf28","original_commit_id":"2944c5bc85c8a4cb691dce3c13659e376504ff1e","user":{"login":"rtbo","id":3889105,"avatar_url":"https://avatars.githubusercontent.com/u/3889105?v=3","gravatar_id":"","url":"https://api.github.com/users/rtbo","html_url":"https://github.com/rtbo","followers_url":"https://api.github.com/users/rtbo/followers","following_url":"https://api.github.com/users/rtbo/following{/other_user}","gists_url":"https://api.github.com/users/rtbo/gists{/gist_id}","starred_url":"https://api.github.com/users/rtbo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rtbo/subscriptions","organizations_url":"https://api.github.com/users/rtbo/orgs","repos_url":"https://api.github.com/users/rtbo/repos","events_url":"https://api.github.com/users/rtbo/events{/privacy}","received_events_url":"https://api.github.com/users/rtbo/received_events","type":"User","site_admin":false},"body":"Is this casting a reference of `self` to a `StructPtr`? Does it bind lifetime of the `StructPtr` to the lifetime of `self`?","created_at":"2016-11-02T21:08:45Z","updated_at":"2016-11-02T21:08:45Z","html_url":"https://github.com/rtbo/rust-xcb/pull/29#discussion_r86242846","pull_request_url":"https://api.github.com/repos/rtbo/rust-xcb/pulls/29","_links":{"self":{"href":"https://api.github.com/repos/rtbo/rust-xcb/pulls/comments/86242846"},"html":{"href":"https://github.com/rtbo/rust-xcb/pull/29#discussion_r86242846"},"pull_request":{"href":"https://api.github.com/repos/rtbo/rust-xcb/pulls/29"}}},"pull_request":{"url":"https://api.github.com/repos/rtbo/rust-xcb/pulls/29","id":91891950,"html_url":"https://github.com/rtbo/rust-xcb/pull/29","diff_url":"https://github.com/rtbo/rust-xcb/pull/29.diff","patch_url":"https://github.com/rtbo/rust-xcb/pull/29.patch","issue_url":"https://api.github.com/repos/rtbo/rust-xcb/issues/29","number":29,"state":"open","locked":false,"title":"Implemented primitive union accessors for struct memebers","user":{"login":"ibabushkin","id":10811417,"avatar_url":"https://avatars.githubusercontent.com/u/10811417?v=3","gravatar_id":"","url":"https://api.github.com/users/ibabushkin","html_url":"https://github.com/ibabushkin","followers_url":"https://api.github.com/users/ibabushkin/followers","following_url":"https://api.github.com/users/ibabushkin/following{/other_user}","gists_url":"https://api.github.com/users/ibabushkin/gists{/gist_id}","starred_url":"https://api.github.com/users/ibabushkin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ibabushkin/subscriptions","organizations_url":"https://api.github.com/users/ibabushkin/orgs","repos_url":"https://api.github.com/users/ibabushkin/repos","events_url":"https://api.github.com/users/ibabushkin/events{/privacy}","received_events_url":"https://api.github.com/users/ibabushkin/received_events","type":"User","site_admin":false},"body":"We simply monkey-patch the type object for `StructPtr`s and handle\r\nthem in a special fashion, as well as generate basic `transmute`-based\r\naccessors for struct members of unions, allowing for a nice solution to #27.\r\n\r\nThis builds with `--features=debug_all`, but further testing (and possibly more through inspection of the problem) is necessary, as this just cures the symptoms, but isn't really beautiful as a solution. I'd love to hear whether this is the right direction, however.","created_at":"2016-11-02T00:50:52Z","updated_at":"2016-11-02T21:08:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5c14c2307bda14249ac8af248546a519f4658ac0","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/rtbo/rust-xcb/pulls/29/commits","review_comments_url":"https://api.github.com/repos/rtbo/rust-xcb/pulls/29/comments","review_comment_url":"https://api.github.com/repos/rtbo/rust-xcb/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rtbo/rust-xcb/issues/29/comments","statuses_url":"https://api.github.com/repos/rtbo/rust-xcb/statuses/d64c20773d684f4b80a6eb8c62c01ef86419cf28","head":{"label":"ibabushkin:master","ref":"master","sha":"d64c20773d684f4b80a6eb8c62c01ef86419cf28","user":{"login":"ibabushkin","id":10811417,"avatar_url":"https://avatars.githubusercontent.com/u/10811417?v=3","gravatar_id":"","url":"https://api.github.com/users/ibabushkin","html_url":"https://github.com/ibabushkin","followers_url":"https://api.github.com/users/ibabushkin/followers","following_url":"https://api.github.com/users/ibabushkin/following{/other_user}","gists_url":"https://api.github.com/users/ibabushkin/gists{/gist_id}","starred_url":"https://api.github.com/users/ibabushkin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ibabushkin/subscriptions","organizations_url":"https://api.github.com/users/ibabushkin/orgs","repos_url":"https://api.github.com/users/ibabushkin/repos","events_url":"https://api.github.com/users/ibabushkin/events{/privacy}","received_events_url":"https://api.github.com/users/ibabushkin/received_events","type":"User","site_admin":false},"repo":{"id":55843840,"name":"rust-xcb","full_name":"ibabushkin/rust-xcb","owner":{"login":"ibabushkin","id":10811417,"avatar_url":"https://avatars.githubusercontent.com/u/10811417?v=3","gravatar_id":"","url":"https://api.github.com/users/ibabushkin","html_url":"https://github.com/ibabushkin","followers_url":"https://api.github.com/users/ibabushkin/followers","following_url":"https://api.github.com/users/ibabushkin/following{/other_user}","gists_url":"https://api.github.com/users/ibabushkin/gists{/gist_id}","starred_url":"https://api.github.com/users/ibabushkin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ibabushkin/subscriptions","organizations_url":"https://api.github.com/users/ibabushkin/orgs","repos_url":"https://api.github.com/users/ibabushkin/repos","events_url":"https://api.github.com/users/ibabushkin/events{/privacy}","received_events_url":"https://api.github.com/users/ibabushkin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ibabushkin/rust-xcb","description":"Rust bindings and wrapper for XCB.","fork":true,"url":"https://api.github.com/repos/ibabushkin/rust-xcb","forks_url":"https://api.github.com/repos/ibabushkin/rust-xcb/forks","keys_url":"https://api.github.com/repos/ibabushkin/rust-xcb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ibabushkin/rust-xcb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ibabushkin/rust-xcb/teams","hooks_url":"https://api.github.com/repos/ibabushkin/rust-xcb/hooks","issue_events_url":"https://api.github.com/repos/ibabushkin/rust-xcb/issues/events{/number}","events_url":"https://api.github.com/repos/ibabushkin/rust-xcb/events","assignees_url":"https://api.github.com/repos/ibabushkin/rust-xcb/assignees{/user}","branches_url":"https://api.github.com/repos/ibabushkin/rust-xcb/branches{/branch}","tags_url":"https://api.github.com/repos/ibabushkin/rust-xcb/tags","blobs_url":"https://api.github.com/repos/ibabushkin/rust-xcb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ibabushkin/rust-xcb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ibabushkin/rust-xcb/git/refs{/sha}","trees_url":"https://api.github.com/repos/ibabushkin/rust-xcb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ibabushkin/rust-xcb/statuses/{sha}","languages_url":"https://api.github.com/repos/ibabushkin/rust-xcb/languages","stargazers_url":"https://api.github.com/repos/ibabushkin/rust-xcb/stargazers","contributors_url":"https://api.github.com/repos/ibabushkin/rust-xcb/contributors","subscribers_url":"https://api.github.com/repos/ibabushkin/rust-xcb/subscribers","subscription_url":"https://api.github.com/repos/ibabushkin/rust-xcb/subscription","commits_url":"https://api.github.com/repos/ibabushkin/rust-xcb/commits{/sha}","git_commits_url":"https://api.github.com/repos/ibabushkin/rust-xcb/git/commits{/sha}","comments_url":"https://api.github.com/repos/ibabushkin/rust-xcb/comments{/number}","issue_comment_url":"https://api.github.com/repos/ibabushkin/rust-xcb/issues/comments{/number}","contents_url":"https://api.github.com/repos/ibabushkin/rust-xcb/contents/{+path}","compare_url":"https://api.github.com/repos/ibabushkin/rust-xcb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ibabushkin/rust-xcb/merges","archive_url":"https://api.github.com/repos/ibabushkin/rust-xcb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ibabushkin/rust-xcb/downloads","issues_url":"https://api.github.com/repos/ibabushkin/rust-xcb/issues{/number}","pulls_url":"https://api.github.com/repos/ibabushkin/rust-xcb/pulls{/number}","milestones_url":"https://api.github.com/repos/ibabushkin/rust-xcb/milestones{/number}","notifications_url":"https://api.github.com/repos/ibabushkin/rust-xcb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ibabushkin/rust-xcb/labels{/name}","releases_url":"https://api.github.com/repos/ibabushkin/rust-xcb/releases{/id}","deployments_url":"https://api.github.com/repos/ibabushkin/rust-xcb/deployments","created_at":"2016-04-09T12:45:48Z","updated_at":"2016-04-09T12:45:49Z","pushed_at":"2016-11-02T18:15:20Z","git_url":"git://github.com/ibabushkin/rust-xcb.git","ssh_url":"git@github.com:ibabushkin/rust-xcb.git","clone_url":"https://github.com/ibabushkin/rust-xcb.git","svn_url":"https://github.com/ibabushkin/rust-xcb","homepage":null,"size":13785,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"rtbo:master","ref":"master","sha":"2328db49e4cb73b97f0c09a1de09b09d2c770ed3","user":{"login":"rtbo","id":3889105,"avatar_url":"https://avatars.githubusercontent.com/u/3889105?v=3","gravatar_id":"","url":"https://api.github.com/users/rtbo","html_url":"https://github.com/rtbo","followers_url":"https://api.github.com/users/rtbo/followers","following_url":"https://api.github.com/users/rtbo/following{/other_user}","gists_url":"https://api.github.com/users/rtbo/gists{/gist_id}","starred_url":"https://api.github.com/users/rtbo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rtbo/subscriptions","organizations_url":"https://api.github.com/users/rtbo/orgs","repos_url":"https://api.github.com/users/rtbo/repos","events_url":"https://api.github.com/users/rtbo/events{/privacy}","received_events_url":"https://api.github.com/users/rtbo/received_events","type":"User","site_admin":false},"repo":{"id":49162998,"name":"rust-xcb","full_name":"rtbo/rust-xcb","owner":{"login":"rtbo","id":3889105,"avatar_url":"https://avatars.githubusercontent.com/u/3889105?v=3","gravatar_id":"","url":"https://api.github.com/users/rtbo","html_url":"https://github.com/rtbo","followers_url":"https://api.github.com/users/rtbo/followers","following_url":"https://api.github.com/users/rtbo/following{/other_user}","gists_url":"https://api.github.com/users/rtbo/gists{/gist_id}","starred_url":"https://api.github.com/users/rtbo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rtbo/subscriptions","organizations_url":"https://api.github.com/users/rtbo/orgs","repos_url":"https://api.github.com/users/rtbo/repos","events_url":"https://api.github.com/users/rtbo/events{/privacy}","received_events_url":"https://api.github.com/users/rtbo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rtbo/rust-xcb","description":"Rust bindings and wrapper for XCB.","fork":true,"url":"https://api.github.com/repos/rtbo/rust-xcb","forks_url":"https://api.github.com/repos/rtbo/rust-xcb/forks","keys_url":"https://api.github.com/repos/rtbo/rust-xcb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rtbo/rust-xcb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rtbo/rust-xcb/teams","hooks_url":"https://api.github.com/repos/rtbo/rust-xcb/hooks","issue_events_url":"https://api.github.com/repos/rtbo/rust-xcb/issues/events{/number}","events_url":"https://api.github.com/repos/rtbo/rust-xcb/events","assignees_url":"https://api.github.com/repos/rtbo/rust-xcb/assignees{/user}","branches_url":"https://api.github.com/repos/rtbo/rust-xcb/branches{/branch}","tags_url":"https://api.github.com/repos/rtbo/rust-xcb/tags","blobs_url":"https://api.github.com/repos/rtbo/rust-xcb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rtbo/rust-xcb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rtbo/rust-xcb/git/refs{/sha}","trees_url":"https://api.github.com/repos/rtbo/rust-xcb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rtbo/rust-xcb/statuses/{sha}","languages_url":"https://api.github.com/repos/rtbo/rust-xcb/languages","stargazers_url":"https://api.github.com/repos/rtbo/rust-xcb/stargazers","contributors_url":"https://api.github.com/repos/rtbo/rust-xcb/contributors","subscribers_url":"https://api.github.com/repos/rtbo/rust-xcb/subscribers","subscription_url":"https://api.github.com/repos/rtbo/rust-xcb/subscription","commits_url":"https://api.github.com/repos/rtbo/rust-xcb/commits{/sha}","git_commits_url":"https://api.github.com/repos/rtbo/rust-xcb/git/commits{/sha}","comments_url":"https://api.github.com/repos/rtbo/rust-xcb/comments{/number}","issue_comment_url":"https://api.github.com/repos/rtbo/rust-xcb/issues/comments{/number}","contents_url":"https://api.github.com/repos/rtbo/rust-xcb/contents/{+path}","compare_url":"https://api.github.com/repos/rtbo/rust-xcb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rtbo/rust-xcb/merges","archive_url":"https://api.github.com/repos/rtbo/rust-xcb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rtbo/rust-xcb/downloads","issues_url":"https://api.github.com/repos/rtbo/rust-xcb/issues{/number}","pulls_url":"https://api.github.com/repos/rtbo/rust-xcb/pulls{/number}","milestones_url":"https://api.github.com/repos/rtbo/rust-xcb/milestones{/number}","notifications_url":"https://api.github.com/repos/rtbo/rust-xcb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rtbo/rust-xcb/labels{/name}","releases_url":"https://api.github.com/repos/rtbo/rust-xcb/releases{/id}","deployments_url":"https://api.github.com/repos/rtbo/rust-xcb/deployments","created_at":"2016-01-06T21:32:55Z","updated_at":"2016-11-01T22:41:03Z","pushed_at":"2016-11-02T18:15:21Z","git_url":"git://github.com/rtbo/rust-xcb.git","ssh_url":"git@github.com:rtbo/rust-xcb.git","clone_url":"https://github.com/rtbo/rust-xcb.git","svn_url":"https://github.com/rtbo/rust-xcb","homepage":null,"size":13763,"stargazers_count":19,"watchers_count":19,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":5,"mirror_url":null,"open_issues_count":4,"forks":5,"open_issues":4,"watchers":19,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rtbo/rust-xcb/pulls/29"},"html":{"href":"https://github.com/rtbo/rust-xcb/pull/29"},"issue":{"href":"https://api.github.com/repos/rtbo/rust-xcb/issues/29"},"comments":{"href":"https://api.github.com/repos/rtbo/rust-xcb/issues/29/comments"},"review_comments":{"href":"https://api.github.com/repos/rtbo/rust-xcb/pulls/29/comments"},"review_comment":{"href":"https://api.github.com/repos/rtbo/rust-xcb/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rtbo/rust-xcb/pulls/29/commits"},"statuses":{"href":"https://api.github.com/repos/rtbo/rust-xcb/statuses/d64c20773d684f4b80a6eb8c62c01ef86419cf28"}}}}
{"actor":{"display_login":"rtbo"}}