{"action":"closed","number":157,"pull_request":{"url":"https://api.github.com/repos/alexcrichton/futures-rs/pulls/157","id":85340228,"html_url":"https://github.com/alexcrichton/futures-rs/pull/157","diff_url":"https://github.com/alexcrichton/futures-rs/pull/157.diff","patch_url":"https://github.com/alexcrichton/futures-rs/pull/157.patch","issue_url":"https://api.github.com/repos/alexcrichton/futures-rs/issues/157","number":157,"state":"closed","locked":false,"title":"stream::once -- one element stream","user":{"login":"stepancheg","id":28969,"avatar_url":"https://avatars.githubusercontent.com/u/28969?v=3","gravatar_id":"","url":"https://api.github.com/users/stepancheg","html_url":"https://github.com/stepancheg","followers_url":"https://api.github.com/users/stepancheg/followers","following_url":"https://api.github.com/users/stepancheg/following{/other_user}","gists_url":"https://api.github.com/users/stepancheg/gists{/gist_id}","starred_url":"https://api.github.com/users/stepancheg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stepancheg/subscriptions","organizations_url":"https://api.github.com/users/stepancheg/orgs","repos_url":"https://api.github.com/users/stepancheg/repos","events_url":"https://api.github.com/users/stepancheg/events{/privacy}","received_events_url":"https://api.github.com/users/stepancheg/received_events","type":"User","site_admin":false},"body":"Name mimics `std::iter::once`.\r\n\r\nTypical use case: you want to stream response body. Caller expects\r\n`Stream<Part>` If your message is already available you can use this\r\nshortcut: `stream::once(Ok(part))`\r\n\r\nUser could instead simply call `stream::iter(iter::once(only))` instead,\r\nbut this function is a shortcut and its result type can be easily named.\r\n\r\nIt also convenient to return errors, e. g.\r\n\r\n```\r\nif !cond {\r\n    return Box::new(stream::once(Err(SomethingWrong)));\r\n}\r\n```\r\n\r\nP. S. Similar function is used 8 times in my grpc implementation, so I believe it is convenient.","created_at":"2016-09-15T03:23:24Z","updated_at":"2016-09-25T19:50:04Z","closed_at":"2016-09-25T19:50:03Z","merged_at":"2016-09-25T19:50:03Z","merge_commit_sha":"0db9792dd58857bb1ad25d3029e31f81310c65ca","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/alexcrichton/futures-rs/pulls/157/commits","review_comments_url":"https://api.github.com/repos/alexcrichton/futures-rs/pulls/157/comments","review_comment_url":"https://api.github.com/repos/alexcrichton/futures-rs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/alexcrichton/futures-rs/issues/157/comments","statuses_url":"https://api.github.com/repos/alexcrichton/futures-rs/statuses/d5072486f968fae8c65649f8c18c98ddb8e1e241","head":{"label":"stepancheg:stream-once","ref":"stream-once","sha":"d5072486f968fae8c65649f8c18c98ddb8e1e241","user":{"login":"stepancheg","id":28969,"avatar_url":"https://avatars.githubusercontent.com/u/28969?v=3","gravatar_id":"","url":"https://api.github.com/users/stepancheg","html_url":"https://github.com/stepancheg","followers_url":"https://api.github.com/users/stepancheg/followers","following_url":"https://api.github.com/users/stepancheg/following{/other_user}","gists_url":"https://api.github.com/users/stepancheg/gists{/gist_id}","starred_url":"https://api.github.com/users/stepancheg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stepancheg/subscriptions","organizations_url":"https://api.github.com/users/stepancheg/orgs","repos_url":"https://api.github.com/users/stepancheg/repos","events_url":"https://api.github.com/users/stepancheg/events{/privacy}","received_events_url":"https://api.github.com/users/stepancheg/received_events","type":"User","site_admin":false},"repo":{"id":66527836,"name":"futures-rs","full_name":"stepancheg/futures-rs","owner":{"login":"stepancheg","id":28969,"avatar_url":"https://avatars.githubusercontent.com/u/28969?v=3","gravatar_id":"","url":"https://api.github.com/users/stepancheg","html_url":"https://github.com/stepancheg","followers_url":"https://api.github.com/users/stepancheg/followers","following_url":"https://api.github.com/users/stepancheg/following{/other_user}","gists_url":"https://api.github.com/users/stepancheg/gists{/gist_id}","starred_url":"https://api.github.com/users/stepancheg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stepancheg/subscriptions","organizations_url":"https://api.github.com/users/stepancheg/orgs","repos_url":"https://api.github.com/users/stepancheg/repos","events_url":"https://api.github.com/users/stepancheg/events{/privacy}","received_events_url":"https://api.github.com/users/stepancheg/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/stepancheg/futures-rs","description":"Zero-cost futures and streams in Rust","fork":true,"url":"https://api.github.com/repos/stepancheg/futures-rs","forks_url":"https://api.github.com/repos/stepancheg/futures-rs/forks","keys_url":"https://api.github.com/repos/stepancheg/futures-rs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stepancheg/futures-rs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stepancheg/futures-rs/teams","hooks_url":"https://api.github.com/repos/stepancheg/futures-rs/hooks","issue_events_url":"https://api.github.com/repos/stepancheg/futures-rs/issues/events{/number}","events_url":"https://api.github.com/repos/stepancheg/futures-rs/events","assignees_url":"https://api.github.com/repos/stepancheg/futures-rs/assignees{/user}","branches_url":"https://api.github.com/repos/stepancheg/futures-rs/branches{/branch}","tags_url":"https://api.github.com/repos/stepancheg/futures-rs/tags","blobs_url":"https://api.github.com/repos/stepancheg/futures-rs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stepancheg/futures-rs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stepancheg/futures-rs/git/refs{/sha}","trees_url":"https://api.github.com/repos/stepancheg/futures-rs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stepancheg/futures-rs/statuses/{sha}","languages_url":"https://api.github.com/repos/stepancheg/futures-rs/languages","stargazers_url":"https://api.github.com/repos/stepancheg/futures-rs/stargazers","contributors_url":"https://api.github.com/repos/stepancheg/futures-rs/contributors","subscribers_url":"https://api.github.com/repos/stepancheg/futures-rs/subscribers","subscription_url":"https://api.github.com/repos/stepancheg/futures-rs/subscription","commits_url":"https://api.github.com/repos/stepancheg/futures-rs/commits{/sha}","git_commits_url":"https://api.github.com/repos/stepancheg/futures-rs/git/commits{/sha}","comments_url":"https://api.github.com/repos/stepancheg/futures-rs/comments{/number}","issue_comment_url":"https://api.github.com/repos/stepancheg/futures-rs/issues/comments{/number}","contents_url":"https://api.github.com/repos/stepancheg/futures-rs/contents/{+path}","compare_url":"https://api.github.com/repos/stepancheg/futures-rs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stepancheg/futures-rs/merges","archive_url":"https://api.github.com/repos/stepancheg/futures-rs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stepancheg/futures-rs/downloads","issues_url":"https://api.github.com/repos/stepancheg/futures-rs/issues{/number}","pulls_url":"https://api.github.com/repos/stepancheg/futures-rs/pulls{/number}","milestones_url":"https://api.github.com/repos/stepancheg/futures-rs/milestones{/number}","notifications_url":"https://api.github.com/repos/stepancheg/futures-rs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stepancheg/futures-rs/labels{/name}","releases_url":"https://api.github.com/repos/stepancheg/futures-rs/releases{/id}","deployments_url":"https://api.github.com/repos/stepancheg/futures-rs/deployments","created_at":"2016-08-25T05:32:48Z","updated_at":"2016-08-25T05:32:49Z","pushed_at":"2016-09-16T04:46:41Z","git_url":"git://github.com/stepancheg/futures-rs.git","ssh_url":"git@github.com:stepancheg/futures-rs.git","clone_url":"https://github.com/stepancheg/futures-rs.git","svn_url":"https://github.com/stepancheg/futures-rs","homepage":"http://alexcrichton.com/futures-rs","size":2419,"stargazers_count":0,"watchers_count":0,"language":"Rust","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"alexcrichton:master","ref":"master","sha":"1b05e0e20ee95eb00d3f476700a678af32d5c225","user":{"login":"alexcrichton","id":64996,"avatar_url":"https://avatars.githubusercontent.com/u/64996?v=3","gravatar_id":"","url":"https://api.github.com/users/alexcrichton","html_url":"https://github.com/alexcrichton","followers_url":"https://api.github.com/users/alexcrichton/followers","following_url":"https://api.github.com/users/alexcrichton/following{/other_user}","gists_url":"https://api.github.com/users/alexcrichton/gists{/gist_id}","starred_url":"https://api.github.com/users/alexcrichton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexcrichton/subscriptions","organizations_url":"https://api.github.com/users/alexcrichton/orgs","repos_url":"https://api.github.com/users/alexcrichton/repos","events_url":"https://api.github.com/users/alexcrichton/events{/privacy}","received_events_url":"https://api.github.com/users/alexcrichton/received_events","type":"User","site_admin":false},"repo":{"id":55077261,"name":"futures-rs","full_name":"alexcrichton/futures-rs","owner":{"login":"alexcrichton","id":64996,"avatar_url":"https://avatars.githubusercontent.com/u/64996?v=3","gravatar_id":"","url":"https://api.github.com/users/alexcrichton","html_url":"https://github.com/alexcrichton","followers_url":"https://api.github.com/users/alexcrichton/followers","following_url":"https://api.github.com/users/alexcrichton/following{/other_user}","gists_url":"https://api.github.com/users/alexcrichton/gists{/gist_id}","starred_url":"https://api.github.com/users/alexcrichton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexcrichton/subscriptions","organizations_url":"https://api.github.com/users/alexcrichton/orgs","repos_url":"https://api.github.com/users/alexcrichton/repos","events_url":"https://api.github.com/users/alexcrichton/events{/privacy}","received_events_url":"https://api.github.com/users/alexcrichton/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/alexcrichton/futures-rs","description":"Zero-cost futures and streams in Rust","fork":false,"url":"https://api.github.com/repos/alexcrichton/futures-rs","forks_url":"https://api.github.com/repos/alexcrichton/futures-rs/forks","keys_url":"https://api.github.com/repos/alexcrichton/futures-rs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alexcrichton/futures-rs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alexcrichton/futures-rs/teams","hooks_url":"https://api.github.com/repos/alexcrichton/futures-rs/hooks","issue_events_url":"https://api.github.com/repos/alexcrichton/futures-rs/issues/events{/number}","events_url":"https://api.github.com/repos/alexcrichton/futures-rs/events","assignees_url":"https://api.github.com/repos/alexcrichton/futures-rs/assignees{/user}","branches_url":"https://api.github.com/repos/alexcrichton/futures-rs/branches{/branch}","tags_url":"https://api.github.com/repos/alexcrichton/futures-rs/tags","blobs_url":"https://api.github.com/repos/alexcrichton/futures-rs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alexcrichton/futures-rs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alexcrichton/futures-rs/git/refs{/sha}","trees_url":"https://api.github.com/repos/alexcrichton/futures-rs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alexcrichton/futures-rs/statuses/{sha}","languages_url":"https://api.github.com/repos/alexcrichton/futures-rs/languages","stargazers_url":"https://api.github.com/repos/alexcrichton/futures-rs/stargazers","contributors_url":"https://api.github.com/repos/alexcrichton/futures-rs/contributors","subscribers_url":"https://api.github.com/repos/alexcrichton/futures-rs/subscribers","subscription_url":"https://api.github.com/repos/alexcrichton/futures-rs/subscription","commits_url":"https://api.github.com/repos/alexcrichton/futures-rs/commits{/sha}","git_commits_url":"https://api.github.com/repos/alexcrichton/futures-rs/git/commits{/sha}","comments_url":"https://api.github.com/repos/alexcrichton/futures-rs/comments{/number}","issue_comment_url":"https://api.github.com/repos/alexcrichton/futures-rs/issues/comments{/number}","contents_url":"https://api.github.com/repos/alexcrichton/futures-rs/contents/{+path}","compare_url":"https://api.github.com/repos/alexcrichton/futures-rs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alexcrichton/futures-rs/merges","archive_url":"https://api.github.com/repos/alexcrichton/futures-rs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alexcrichton/futures-rs/downloads","issues_url":"https://api.github.com/repos/alexcrichton/futures-rs/issues{/number}","pulls_url":"https://api.github.com/repos/alexcrichton/futures-rs/pulls{/number}","milestones_url":"https://api.github.com/repos/alexcrichton/futures-rs/milestones{/number}","notifications_url":"https://api.github.com/repos/alexcrichton/futures-rs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alexcrichton/futures-rs/labels{/name}","releases_url":"https://api.github.com/repos/alexcrichton/futures-rs/releases{/id}","deployments_url":"https://api.github.com/repos/alexcrichton/futures-rs/deployments","created_at":"2016-03-30T16:03:08Z","updated_at":"2016-09-25T08:21:25Z","pushed_at":"2016-09-25T19:50:03Z","git_url":"git://github.com/alexcrichton/futures-rs.git","ssh_url":"git@github.com:alexcrichton/futures-rs.git","clone_url":"https://github.com/alexcrichton/futures-rs.git","svn_url":"https://github.com/alexcrichton/futures-rs","homepage":"http://alexcrichton.com/futures-rs","size":2211,"stargazers_count":1020,"watchers_count":1020,"language":"Rust","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":69,"mirror_url":null,"open_issues_count":29,"forks":69,"open_issues":29,"watchers":1020,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/alexcrichton/futures-rs/pulls/157"},"html":{"href":"https://github.com/alexcrichton/futures-rs/pull/157"},"issue":{"href":"https://api.github.com/repos/alexcrichton/futures-rs/issues/157"},"comments":{"href":"https://api.github.com/repos/alexcrichton/futures-rs/issues/157/comments"},"review_comments":{"href":"https://api.github.com/repos/alexcrichton/futures-rs/pulls/157/comments"},"review_comment":{"href":"https://api.github.com/repos/alexcrichton/futures-rs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/alexcrichton/futures-rs/pulls/157/commits"},"statuses":{"href":"https://api.github.com/repos/alexcrichton/futures-rs/statuses/d5072486f968fae8c65649f8c18c98ddb8e1e241"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"alexcrichton","id":64996,"avatar_url":"https://avatars.githubusercontent.com/u/64996?v=3","gravatar_id":"","url":"https://api.github.com/users/alexcrichton","html_url":"https://github.com/alexcrichton","followers_url":"https://api.github.com/users/alexcrichton/followers","following_url":"https://api.github.com/users/alexcrichton/following{/other_user}","gists_url":"https://api.github.com/users/alexcrichton/gists{/gist_id}","starred_url":"https://api.github.com/users/alexcrichton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexcrichton/subscriptions","organizations_url":"https://api.github.com/users/alexcrichton/orgs","repos_url":"https://api.github.com/users/alexcrichton/repos","events_url":"https://api.github.com/users/alexcrichton/events{/privacy}","received_events_url":"https://api.github.com/users/alexcrichton/received_events","type":"User","site_admin":false},"comments":0,"review_comments":0,"commits":1,"additions":36,"deletions":0,"changed_files":2}}
{"actor":{"display_login":"alexcrichton"}}