{"action":"created","issue":{"url":"https://api.github.com/repos/iron/iron/issues/347","labels_url":"https://api.github.com/repos/iron/iron/issues/347/labels{/name}","comments_url":"https://api.github.com/repos/iron/iron/issues/347/comments","events_url":"https://api.github.com/repos/iron/iron/issues/347/events","html_url":"https://github.com/iron/iron/issues/347","id":80080728,"number":347,"title":"Easier chain construction","user":{"login":"viraptor","id":188063,"avatar_url":"https://avatars.githubusercontent.com/u/188063?v=3","gravatar_id":"","url":"https://api.github.com/users/viraptor","html_url":"https://github.com/viraptor","followers_url":"https://api.github.com/users/viraptor/followers","following_url":"https://api.github.com/users/viraptor/following{/other_user}","gists_url":"https://api.github.com/users/viraptor/gists{/gist_id}","starred_url":"https://api.github.com/users/viraptor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/viraptor/subscriptions","organizations_url":"https://api.github.com/users/viraptor/orgs","repos_url":"https://api.github.com/users/viraptor/repos","events_url":"https://api.github.com/users/viraptor/events{/privacy}","received_events_url":"https://api.github.com/users/viraptor/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-05-24T07:18:40Z","updated_at":"2015-06-25T20:52:47Z","closed_at":null,"body":"Sometimes I'd like to use additional middleware only for a specific few links, rather than the whole app. For example it's easier to enforce extracting body parameters by wrapping a handler rather than repeating the boilerplate code. But current code requires something like:\r\n\r\n```\r\nlet mut another_chain = Chain::new(the_handler);\r\nanother_chain.link_before(body_extractor);\r\nanother_chain.link_before(login_validator);\r\n...\r\n```\r\n\r\nHow about including a simplified chain constructor like:\r\n\r\n```\r\nChain::new_with(vec![before1, before2], the_handler, vec![after1, after2])\r\n```"},"comment":{"url":"https://api.github.com/repos/iron/iron/issues/comments/115393894","html_url":"https://github.com/iron/iron/issues/347#issuecomment-115393894","issue_url":"https://api.github.com/repos/iron/iron/issues/347","id":115393894,"user":{"login":"reem","id":4745181,"avatar_url":"https://avatars.githubusercontent.com/u/4745181?v=3","gravatar_id":"","url":"https://api.github.com/users/reem","html_url":"https://github.com/reem","followers_url":"https://api.github.com/users/reem/followers","following_url":"https://api.github.com/users/reem/following{/other_user}","gists_url":"https://api.github.com/users/reem/gists{/gist_id}","starred_url":"https://api.github.com/users/reem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reem/subscriptions","organizations_url":"https://api.github.com/users/reem/orgs","repos_url":"https://api.github.com/users/reem/repos","events_url":"https://api.github.com/users/reem/events{/privacy}","received_events_url":"https://api.github.com/users/reem/received_events","type":"User","site_admin":false},"created_at":"2015-06-25T20:52:47Z","updated_at":"2015-06-25T20:52:47Z","body":"Though I do agree that sugar for constructing chains is definitely desirable."}}