{"action":"created","issue":{"url":"https://api.github.com/repos/serde-rs/serde/issues/651","repository_url":"https://api.github.com/repos/serde-rs/serde","labels_url":"https://api.github.com/repos/serde-rs/serde/issues/651/labels{/name}","comments_url":"https://api.github.com/repos/serde-rs/serde/issues/651/comments","events_url":"https://api.github.com/repos/serde-rs/serde/issues/651/events","html_url":"https://github.com/serde-rs/serde/issues/651","id":197441362,"number":651,"title":"Enforce correct use of Serialize and Deserialize traits","user":{"login":"dtolnay","id":1940490,"avatar_url":"https://avatars.githubusercontent.com/u/1940490?v=3","gravatar_id":"","url":"https://api.github.com/users/dtolnay","html_url":"https://github.com/dtolnay","followers_url":"https://api.github.com/users/dtolnay/followers","following_url":"https://api.github.com/users/dtolnay/following{/other_user}","gists_url":"https://api.github.com/users/dtolnay/gists{/gist_id}","starred_url":"https://api.github.com/users/dtolnay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dtolnay/subscriptions","organizations_url":"https://api.github.com/users/dtolnay/orgs","repos_url":"https://api.github.com/users/dtolnay/repos","events_url":"https://api.github.com/users/dtolnay/events{/privacy}","received_events_url":"https://api.github.com/users/dtolnay/received_events","type":"User","site_admin":false},"labels":[{"id":376144083,"url":"https://api.github.com/repos/serde-rs/serde/labels/discussion","name":"discussion","color":"fbca04","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-12-24T01:03:52Z","updated_at":"2016-12-25T00:03:43Z","closed_at":null,"body":"Currently the responsibilities of these traits are:\r\n\r\n- **Serialize** - make exactly one primitive Serializer call or exactly one chain of begin/elt/end complex Serializer calls\r\n- **Deserialize** - make exactly one Deserializer call\r\n\r\nBut the type system does not enforce this in either case - you can make zero or more than one call. The result will be a correctly-written Serializer generating invalid output or a correctly-written Deserializer accepting invalid input / rejecting valid input.\r\n\r\nLet's see if we can foolproof these."},"comment":{"url":"https://api.github.com/repos/serde-rs/serde/issues/comments/269104843","html_url":"https://github.com/serde-rs/serde/issues/651#issuecomment-269104843","issue_url":"https://api.github.com/repos/serde-rs/serde/issues/651","id":269104843,"user":{"login":"oli-obk","id":332036,"avatar_url":"https://avatars.githubusercontent.com/u/332036?v=3","gravatar_id":"","url":"https://api.github.com/users/oli-obk","html_url":"https://github.com/oli-obk","followers_url":"https://api.github.com/users/oli-obk/followers","following_url":"https://api.github.com/users/oli-obk/following{/other_user}","gists_url":"https://api.github.com/users/oli-obk/gists{/gist_id}","starred_url":"https://api.github.com/users/oli-obk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oli-obk/subscriptions","organizations_url":"https://api.github.com/users/oli-obk/orgs","repos_url":"https://api.github.com/users/oli-obk/repos","events_url":"https://api.github.com/users/oli-obk/events{/privacy}","received_events_url":"https://api.github.com/users/oli-obk/received_events","type":"User","site_admin":false},"created_at":"2016-12-25T00:03:43Z","updated_at":"2016-12-25T00:03:43Z","body":"If we change the `Serialize` trait to take a `SerializerRef` object that is consumed instead of taking references (and internally has a reference to the actual Serializer) we might be able to enforce it through ownership"}}
{"actor":{"display_login":"oli-obk"}}