{"action":"created","issue":{"url":"https://api.github.com/repos/UpstandingHackers/hammer/issues/64","labels_url":"https://api.github.com/repos/UpstandingHackers/hammer/issues/64/labels{/name}","comments_url":"https://api.github.com/repos/UpstandingHackers/hammer/issues/64/comments","events_url":"https://api.github.com/repos/UpstandingHackers/hammer/issues/64/events","html_url":"https://github.com/UpstandingHackers/hammer/issues/64","id":23286348,"number":64,"title":"Rust bindings","user":{"login":"tarcieri","id":797,"avatar_url":"https://avatars.githubusercontent.com/u/797?v=3","gravatar_id":"","url":"https://api.github.com/users/tarcieri","html_url":"https://github.com/tarcieri","followers_url":"https://api.github.com/users/tarcieri/followers","following_url":"https://api.github.com/users/tarcieri/following{/other_user}","gists_url":"https://api.github.com/users/tarcieri/gists{/gist_id}","starred_url":"https://api.github.com/users/tarcieri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tarcieri/subscriptions","organizations_url":"https://api.github.com/users/tarcieri/orgs","repos_url":"https://api.github.com/users/tarcieri/repos","events_url":"https://api.github.com/users/tarcieri/events{/privacy}","received_events_url":"https://api.github.com/users/tarcieri/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":19,"created_at":"2013-11-26T00:46:24Z","updated_at":"2015-07-31T10:39:42Z","closed_at":null,"body":"I've been playing around with Mozilla's Rust language lately:\r\n\r\nhttp://www.rust-lang.org/\r\n\r\nIt'd be nice if there were Hammer bindings for it!"},"comment":{"url":"https://api.github.com/repos/UpstandingHackers/hammer/issues/comments/126643874","html_url":"https://github.com/UpstandingHackers/hammer/issues/64#issuecomment-126643874","issue_url":"https://api.github.com/repos/UpstandingHackers/hammer/issues/64","id":126643874,"user":{"login":"abiggerhammer","id":105089,"avatar_url":"https://avatars.githubusercontent.com/u/105089?v=3","gravatar_id":"","url":"https://api.github.com/users/abiggerhammer","html_url":"https://github.com/abiggerhammer","followers_url":"https://api.github.com/users/abiggerhammer/followers","following_url":"https://api.github.com/users/abiggerhammer/following{/other_user}","gists_url":"https://api.github.com/users/abiggerhammer/gists{/gist_id}","starred_url":"https://api.github.com/users/abiggerhammer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abiggerhammer/subscriptions","organizations_url":"https://api.github.com/users/abiggerhammer/orgs","repos_url":"https://api.github.com/users/abiggerhammer/repos","events_url":"https://api.github.com/users/abiggerhammer/events{/privacy}","received_events_url":"https://api.github.com/users/abiggerhammer/received_events","type":"User","site_admin":false},"created_at":"2015-07-31T10:39:42Z","updated_at":"2015-07-31T10:39:42Z","body":"`HInputStream` [keeps track of how much of an input has been consumed](https://github.com/UpstandingHackers/hammer/blob/master/src/internal.h#L67-L77), at the byte level (the `index` field) and the bit level (the `bit_offset` field). So if you had a parser like:\r\n\r\n```\r\nh_sequence(h_bits(3), h_uint8(), h_bits(5));\r\n```\r\n\r\nand applied it to a two-byte input, the state of the HInputStream would change as follows:\r\n\r\n```\r\nindex: 0, bit_offset: 0\r\nindex: 0, bit_offset: 3\r\nindex: 1, bit_offset: 3\r\nindex: 2, bit_offset: 0\r\n```\r\n\r\nWhile you're here, btw, I like the Producer abstraction you've come up with; maybe that's the right solution for file/network/&c inputs in hammer as well.\r\n\r\nAs regards Rust bindings for hammer, though -- I'm happy to help finish them up (perhaps from @skade's `rusty-hammer` mentioned above) if that would be helpful in the short term. "}}