{"action":"created","comment":{"url":"https://api.github.com/repos/mehcode/shio-rs/pulls/comments/139116334","pull_request_review_id":63005058,"id":139116334,"diff_hunk":"@@ -0,0 +1,85 @@\n+\n+use tokio_core::reactor::Handle;\n+use std::sync::Arc;\n+use unsafe_any::UnsafeAny;\n+use hyper::{Method, error, HttpVersion, Body};\n+use hyper::header::Header;\n+\n+use super::Context;\n+use state::State;\n+use util::typemap::TypeMap;\n+use request;\n+use data;\n+\n+/// Helper struct for construct a [`Context`]\n+///\n+/// [`Context`]: struct.Context.html\n+pub struct Builder {\n+    handle: Handle,\n+\n+    state: State,\n+\n+    // for request\n+    request: request::Builder,\n+    body: Body,\n+}\n+\n+impl Builder {\n+    /// Create a new `Builder` from a tokio_core `Handle`\n+    pub fn new(handle: Handle) -> Self {\n+        Self {\n+            handle,\n+            state: State::default(),\n+            request: request::Builder::default(),\n+            body: Body::default(),\n+        }\n+    }\n+\n+    /// Set the shared data.\n+    pub fn shared(mut self, shared: Arc<TypeMap<UnsafeAny + Send + Sync>>) -> Self {\n+        self.state.shared = shared;\n+        self\n+    }\n+\n+    /// Set the HTTP method to `method`\n+    pub fn method(mut self, method: Method) -> Self {\n+        self.request = self.request.method(method);\n+        self\n+    }\n+\n+    /// Set the uri\n+    pub fn uri(mut self, uri: &str) -> Self {\n+        self.request = self.request.uri(uri);\n+        self\n+    }\n+\n+    /// Set the HTTP version\n+    pub fn version(mut self, ver: HttpVersion) -> Self {\n+        self.request = self.request.version(ver);\n+        self\n+    }\n+\n+    /// Set an header\n+    pub fn set_header<H: Header>(mut self, value: H) -> Self {","path":"lib/src/context/builder.rs","position":63,"original_position":63,"commit_id":"2e0759fb045745d2e2afe7cce1813b5ef43ca6c3","original_commit_id":"e968765d5a929a1beb6789e10a5324ac40d56185","user":{"login":"mehcode","id":753919,"avatar_url":"https://avatars1.githubusercontent.com/u/753919?v=4","gravatar_id":"","url":"https://api.github.com/users/mehcode","html_url":"https://github.com/mehcode","followers_url":"https://api.github.com/users/mehcode/followers","following_url":"https://api.github.com/users/mehcode/following{/other_user}","gists_url":"https://api.github.com/users/mehcode/gists{/gist_id}","starred_url":"https://api.github.com/users/mehcode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mehcode/subscriptions","organizations_url":"https://api.github.com/users/mehcode/orgs","repos_url":"https://api.github.com/users/mehcode/repos","events_url":"https://api.github.com/users/mehcode/events{/privacy}","received_events_url":"https://api.github.com/users/mehcode/received_events","type":"User","site_admin":false},"body":"Methods on a builder should be just `header` and not `set_header`. See a similar method on `http::request::Builder`: https://docs.rs/http/0.1.0/http/request/struct.Builder.html#method.header","created_at":"2017-09-15T10:34:12Z","updated_at":"2017-09-15T10:40:13Z","html_url":"https://github.com/mehcode/shio-rs/pull/24#discussion_r139116334","pull_request_url":"https://api.github.com/repos/mehcode/shio-rs/pulls/24","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/mehcode/shio-rs/pulls/comments/139116334"},"html":{"href":"https://github.com/mehcode/shio-rs/pull/24#discussion_r139116334"},"pull_request":{"href":"https://api.github.com/repos/mehcode/shio-rs/pulls/24"}}},"pull_request":{"url":"https://api.github.com/repos/mehcode/shio-rs/pulls/24","id":141271000,"html_url":"https://github.com/mehcode/shio-rs/pull/24","diff_url":"https://github.com/mehcode/shio-rs/pull/24.diff","patch_url":"https://github.com/mehcode/shio-rs/pull/24.patch","issue_url":"https://api.github.com/repos/mehcode/shio-rs/issues/24","number":24,"state":"open","locked":false,"title":"Add context::Builder","user":{"login":"Meralis40","id":11294899,"avatar_url":"https://avatars1.githubusercontent.com/u/11294899?v=4","gravatar_id":"","url":"https://api.github.com/users/Meralis40","html_url":"https://github.com/Meralis40","followers_url":"https://api.github.com/users/Meralis40/followers","following_url":"https://api.github.com/users/Meralis40/following{/other_user}","gists_url":"https://api.github.com/users/Meralis40/gists{/gist_id}","starred_url":"https://api.github.com/users/Meralis40/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Meralis40/subscriptions","organizations_url":"https://api.github.com/users/Meralis40/orgs","repos_url":"https://api.github.com/users/Meralis40/repos","events_url":"https://api.github.com/users/Meralis40/events{/privacy}","received_events_url":"https://api.github.com/users/Meralis40/received_events","type":"User","site_admin":false},"body":"Add `context::Builder`, a helper struct for creating a `Context`.\r\nAlso modify `Router` tests to use the new `Builder`.\r\n\r\nCloses #22 ","created_at":"2017-09-15T09:49:26Z","updated_at":"2017-09-15T10:40:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"54615e335391fca458df856718819f6c57483b36","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/mehcode/shio-rs/pulls/24/commits","review_comments_url":"https://api.github.com/repos/mehcode/shio-rs/pulls/24/comments","review_comment_url":"https://api.github.com/repos/mehcode/shio-rs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mehcode/shio-rs/issues/24/comments","statuses_url":"https://api.github.com/repos/mehcode/shio-rs/statuses/2e0759fb045745d2e2afe7cce1813b5ef43ca6c3","head":{"label":"Meralis40:contextbuilder","ref":"contextbuilder","sha":"2e0759fb045745d2e2afe7cce1813b5ef43ca6c3","user":{"login":"Meralis40","id":11294899,"avatar_url":"https://avatars1.githubusercontent.com/u/11294899?v=4","gravatar_id":"","url":"https://api.github.com/users/Meralis40","html_url":"https://github.com/Meralis40","followers_url":"https://api.github.com/users/Meralis40/followers","following_url":"https://api.github.com/users/Meralis40/following{/other_user}","gists_url":"https://api.github.com/users/Meralis40/gists{/gist_id}","starred_url":"https://api.github.com/users/Meralis40/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Meralis40/subscriptions","organizations_url":"https://api.github.com/users/Meralis40/orgs","repos_url":"https://api.github.com/users/Meralis40/repos","events_url":"https://api.github.com/users/Meralis40/events{/privacy}","received_events_url":"https://api.github.com/users/Meralis40/received_events","type":"User","site_admin":false},"repo":{"id":101161378,"name":"shio-rs","full_name":"Meralis40/shio-rs","owner":{"login":"Meralis40","id":11294899,"avatar_url":"https://avatars1.githubusercontent.com/u/11294899?v=4","gravatar_id":"","url":"https://api.github.com/users/Meralis40","html_url":"https://github.com/Meralis40","followers_url":"https://api.github.com/users/Meralis40/followers","following_url":"https://api.github.com/users/Meralis40/following{/other_user}","gists_url":"https://api.github.com/users/Meralis40/gists{/gist_id}","starred_url":"https://api.github.com/users/Meralis40/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Meralis40/subscriptions","organizations_url":"https://api.github.com/users/Meralis40/orgs","repos_url":"https://api.github.com/users/Meralis40/repos","events_url":"https://api.github.com/users/Meralis40/events{/privacy}","received_events_url":"https://api.github.com/users/Meralis40/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Meralis40/shio-rs","description":"Shio is a fast, simple, and asynchronous micro web-framework for Rust.","fork":true,"url":"https://api.github.com/repos/Meralis40/shio-rs","forks_url":"https://api.github.com/repos/Meralis40/shio-rs/forks","keys_url":"https://api.github.com/repos/Meralis40/shio-rs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Meralis40/shio-rs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Meralis40/shio-rs/teams","hooks_url":"https://api.github.com/repos/Meralis40/shio-rs/hooks","issue_events_url":"https://api.github.com/repos/Meralis40/shio-rs/issues/events{/number}","events_url":"https://api.github.com/repos/Meralis40/shio-rs/events","assignees_url":"https://api.github.com/repos/Meralis40/shio-rs/assignees{/user}","branches_url":"https://api.github.com/repos/Meralis40/shio-rs/branches{/branch}","tags_url":"https://api.github.com/repos/Meralis40/shio-rs/tags","blobs_url":"https://api.github.com/repos/Meralis40/shio-rs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Meralis40/shio-rs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Meralis40/shio-rs/git/refs{/sha}","trees_url":"https://api.github.com/repos/Meralis40/shio-rs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Meralis40/shio-rs/statuses/{sha}","languages_url":"https://api.github.com/repos/Meralis40/shio-rs/languages","stargazers_url":"https://api.github.com/repos/Meralis40/shio-rs/stargazers","contributors_url":"https://api.github.com/repos/Meralis40/shio-rs/contributors","subscribers_url":"https://api.github.com/repos/Meralis40/shio-rs/subscribers","subscription_url":"https://api.github.com/repos/Meralis40/shio-rs/subscription","commits_url":"https://api.github.com/repos/Meralis40/shio-rs/commits{/sha}","git_commits_url":"https://api.github.com/repos/Meralis40/shio-rs/git/commits{/sha}","comments_url":"https://api.github.com/repos/Meralis40/shio-rs/comments{/number}","issue_comment_url":"https://api.github.com/repos/Meralis40/shio-rs/issues/comments{/number}","contents_url":"https://api.github.com/repos/Meralis40/shio-rs/contents/{+path}","compare_url":"https://api.github.com/repos/Meralis40/shio-rs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Meralis40/shio-rs/merges","archive_url":"https://api.github.com/repos/Meralis40/shio-rs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Meralis40/shio-rs/downloads","issues_url":"https://api.github.com/repos/Meralis40/shio-rs/issues{/number}","pulls_url":"https://api.github.com/repos/Meralis40/shio-rs/pulls{/number}","milestones_url":"https://api.github.com/repos/Meralis40/shio-rs/milestones{/number}","notifications_url":"https://api.github.com/repos/Meralis40/shio-rs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Meralis40/shio-rs/labels{/name}","releases_url":"https://api.github.com/repos/Meralis40/shio-rs/releases{/id}","deployments_url":"https://api.github.com/repos/Meralis40/shio-rs/deployments","created_at":"2017-08-23T09:13:35Z","updated_at":"2017-08-23T09:13:36Z","pushed_at":"2017-09-15T10:32:21Z","git_url":"git://github.com/Meralis40/shio-rs.git","ssh_url":"git@github.com:Meralis40/shio-rs.git","clone_url":"https://github.com/Meralis40/shio-rs.git","svn_url":"https://github.com/Meralis40/shio-rs","homepage":"","size":203,"stargazers_count":0,"watchers_count":0,"language":"Rust","has_issues":false,"has_projects":true,"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":"mehcode:master","ref":"master","sha":"19ea0818bee46e5791cb4c91cc80c5ff42efffca","user":{"login":"mehcode","id":753919,"avatar_url":"https://avatars1.githubusercontent.com/u/753919?v=4","gravatar_id":"","url":"https://api.github.com/users/mehcode","html_url":"https://github.com/mehcode","followers_url":"https://api.github.com/users/mehcode/followers","following_url":"https://api.github.com/users/mehcode/following{/other_user}","gists_url":"https://api.github.com/users/mehcode/gists{/gist_id}","starred_url":"https://api.github.com/users/mehcode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mehcode/subscriptions","organizations_url":"https://api.github.com/users/mehcode/orgs","repos_url":"https://api.github.com/users/mehcode/repos","events_url":"https://api.github.com/users/mehcode/events{/privacy}","received_events_url":"https://api.github.com/users/mehcode/received_events","type":"User","site_admin":false},"repo":{"id":100137055,"name":"shio-rs","full_name":"mehcode/shio-rs","owner":{"login":"mehcode","id":753919,"avatar_url":"https://avatars1.githubusercontent.com/u/753919?v=4","gravatar_id":"","url":"https://api.github.com/users/mehcode","html_url":"https://github.com/mehcode","followers_url":"https://api.github.com/users/mehcode/followers","following_url":"https://api.github.com/users/mehcode/following{/other_user}","gists_url":"https://api.github.com/users/mehcode/gists{/gist_id}","starred_url":"https://api.github.com/users/mehcode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mehcode/subscriptions","organizations_url":"https://api.github.com/users/mehcode/orgs","repos_url":"https://api.github.com/users/mehcode/repos","events_url":"https://api.github.com/users/mehcode/events{/privacy}","received_events_url":"https://api.github.com/users/mehcode/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mehcode/shio-rs","description":"Shio is a fast, simple, and asynchronous micro web-framework for Rust.","fork":false,"url":"https://api.github.com/repos/mehcode/shio-rs","forks_url":"https://api.github.com/repos/mehcode/shio-rs/forks","keys_url":"https://api.github.com/repos/mehcode/shio-rs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mehcode/shio-rs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mehcode/shio-rs/teams","hooks_url":"https://api.github.com/repos/mehcode/shio-rs/hooks","issue_events_url":"https://api.github.com/repos/mehcode/shio-rs/issues/events{/number}","events_url":"https://api.github.com/repos/mehcode/shio-rs/events","assignees_url":"https://api.github.com/repos/mehcode/shio-rs/assignees{/user}","branches_url":"https://api.github.com/repos/mehcode/shio-rs/branches{/branch}","tags_url":"https://api.github.com/repos/mehcode/shio-rs/tags","blobs_url":"https://api.github.com/repos/mehcode/shio-rs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mehcode/shio-rs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mehcode/shio-rs/git/refs{/sha}","trees_url":"https://api.github.com/repos/mehcode/shio-rs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mehcode/shio-rs/statuses/{sha}","languages_url":"https://api.github.com/repos/mehcode/shio-rs/languages","stargazers_url":"https://api.github.com/repos/mehcode/shio-rs/stargazers","contributors_url":"https://api.github.com/repos/mehcode/shio-rs/contributors","subscribers_url":"https://api.github.com/repos/mehcode/shio-rs/subscribers","subscription_url":"https://api.github.com/repos/mehcode/shio-rs/subscription","commits_url":"https://api.github.com/repos/mehcode/shio-rs/commits{/sha}","git_commits_url":"https://api.github.com/repos/mehcode/shio-rs/git/commits{/sha}","comments_url":"https://api.github.com/repos/mehcode/shio-rs/comments{/number}","issue_comment_url":"https://api.github.com/repos/mehcode/shio-rs/issues/comments{/number}","contents_url":"https://api.github.com/repos/mehcode/shio-rs/contents/{+path}","compare_url":"https://api.github.com/repos/mehcode/shio-rs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mehcode/shio-rs/merges","archive_url":"https://api.github.com/repos/mehcode/shio-rs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mehcode/shio-rs/downloads","issues_url":"https://api.github.com/repos/mehcode/shio-rs/issues{/number}","pulls_url":"https://api.github.com/repos/mehcode/shio-rs/pulls{/number}","milestones_url":"https://api.github.com/repos/mehcode/shio-rs/milestones{/number}","notifications_url":"https://api.github.com/repos/mehcode/shio-rs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mehcode/shio-rs/labels{/name}","releases_url":"https://api.github.com/repos/mehcode/shio-rs/releases{/id}","deployments_url":"https://api.github.com/repos/mehcode/shio-rs/deployments","created_at":"2017-08-12T20:47:57Z","updated_at":"2017-09-14T10:15:06Z","pushed_at":"2017-09-15T10:32:26Z","git_url":"git://github.com/mehcode/shio-rs.git","ssh_url":"git@github.com:mehcode/shio-rs.git","clone_url":"https://github.com/mehcode/shio-rs.git","svn_url":"https://github.com/mehcode/shio-rs","homepage":"","size":211,"stargazers_count":153,"watchers_count":153,"language":"Rust","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":10,"forks":6,"open_issues":10,"watchers":153,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mehcode/shio-rs/pulls/24"},"html":{"href":"https://github.com/mehcode/shio-rs/pull/24"},"issue":{"href":"https://api.github.com/repos/mehcode/shio-rs/issues/24"},"comments":{"href":"https://api.github.com/repos/mehcode/shio-rs/issues/24/comments"},"review_comments":{"href":"https://api.github.com/repos/mehcode/shio-rs/pulls/24/comments"},"review_comment":{"href":"https://api.github.com/repos/mehcode/shio-rs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mehcode/shio-rs/pulls/24/commits"},"statuses":{"href":"https://api.github.com/repos/mehcode/shio-rs/statuses/2e0759fb045745d2e2afe7cce1813b5ef43ca6c3"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"mehcode"}}