{"action":"opened","issue":{"url":"https://api.github.com/repos/PistonDevelopers/event/issues/314","labels_url":"https://api.github.com/repos/PistonDevelopers/event/issues/314/labels{/name}","comments_url":"https://api.github.com/repos/PistonDevelopers/event/issues/314/comments","events_url":"https://api.github.com/repos/PistonDevelopers/event/issues/314/events","html_url":"https://github.com/PistonDevelopers/event/issues/314","id":54754362,"number":314,"title":"Use a flexible interface on `GenericEvent`","user":{"login":"bvssvni","id":1743862,"avatar_url":"https://avatars.githubusercontent.com/u/1743862?v=3","gravatar_id":"","url":"https://api.github.com/users/bvssvni","html_url":"https://github.com/bvssvni","followers_url":"https://api.github.com/users/bvssvni/followers","following_url":"https://api.github.com/users/bvssvni/following{/other_user}","gists_url":"https://api.github.com/users/bvssvni/gists{/gist_id}","starred_url":"https://api.github.com/users/bvssvni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bvssvni/subscriptions","organizations_url":"https://api.github.com/users/bvssvni/orgs","repos_url":"https://api.github.com/users/bvssvni/repos","events_url":"https://api.github.com/users/bvssvni/events{/privacy}","received_events_url":"https://api.github.com/users/bvssvni/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/PistonDevelopers/event/labels/Discussion","name":"Discussion","color":"bfe5bf"},{"url":"https://api.github.com/repos/PistonDevelopers/event/labels/Draft","name":"Draft","color":"e11d21"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-01-19T11:43:47Z","updated_at":"2015-01-19T11:43:47Z","closed_at":null,"body":"One idea to solve the custom event problem is to add multiple methods to `GenericEvent` that returns information similar to how a dynamically typed table would work. A flat structure is probably good enough for events.\r\n\r\n```Rust\r\npub trait GenericEvent {\r\n    fn desc(&self) -> &str;\r\n    fn event_id(&self) -> u64;\r\n    fn get_f64(&self, key: &str) -> f64;\r\n    fn get_u64(&self, key: &str) -> u64;\r\n    fn get_bool(&self, key: &str) -> bool;\r\n    fn get_str(&self, key: &str) -> &str;\r\n}\r\n```"}}