{"action":"created","issue":{"url":"https://api.github.com/repos/stepancheg/rust-protobuf/issues/270","repository_url":"https://api.github.com/repos/stepancheg/rust-protobuf","labels_url":"https://api.github.com/repos/stepancheg/rust-protobuf/issues/270/labels{/name}","comments_url":"https://api.github.com/repos/stepancheg/rust-protobuf/issues/270/comments","events_url":"https://api.github.com/repos/stepancheg/rust-protobuf/issues/270/events","html_url":"https://github.com/stepancheg/rust-protobuf/issues/270","id":302543465,"node_id":"MDU6SXNzdWUzMDI1NDM0NjU=","number":270,"title":"Very basic question: How to encode for sending?","user":{"login":"anderspitman","id":7820200,"node_id":"MDQ6VXNlcjc4MjAyMDA=","avatar_url":"https://avatars3.githubusercontent.com/u/7820200?v=4","gravatar_id":"","url":"https://api.github.com/users/anderspitman","html_url":"https://github.com/anderspitman","followers_url":"https://api.github.com/users/anderspitman/followers","following_url":"https://api.github.com/users/anderspitman/following{/other_user}","gists_url":"https://api.github.com/users/anderspitman/gists{/gist_id}","starred_url":"https://api.github.com/users/anderspitman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anderspitman/subscriptions","organizations_url":"https://api.github.com/users/anderspitman/orgs","repos_url":"https://api.github.com/users/anderspitman/repos","events_url":"https://api.github.com/users/anderspitman/events{/privacy}","received_events_url":"https://api.github.com/users/anderspitman/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-03-06T02:44:28Z","updated_at":"2018-06-09T01:28:10Z","closed_at":"2018-03-20T00:12:40Z","author_association":"NONE","body":"Sorry I know this is the most basic functionality, but this is my first time using protocol buffers and I'm also fairly new to Rust. I have my proto file being compiled correctly, and I'm able to import the generated Rust module, instantiate messages, and populate values. What method should I call to convert it to text/binary/whatever to send over the wire (a websocket, if that matters) for decoding by my javascript (protobuf.js) application?\r\n\r\nSorry if this is documented some and I missed it. Digging through the generated Rust file didn't yield anything obvious to me either.\r\n\r\nThanks!\r\n//anders"},"comment":{"url":"https://api.github.com/repos/stepancheg/rust-protobuf/issues/comments/395929658","html_url":"https://github.com/stepancheg/rust-protobuf/issues/270#issuecomment-395929658","issue_url":"https://api.github.com/repos/stepancheg/rust-protobuf/issues/270","id":395929658,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NTkyOTY1OA==","user":{"login":"stepancheg","id":28969,"node_id":"MDQ6VXNlcjI4OTY5","avatar_url":"https://avatars2.githubusercontent.com/u/28969?v=4","gravatar_id":"","url":"https://api.github.com/users/stepancheg","html_url":"https://github.com/stepancheg","followers_url":"https://api.github.com/users/stepancheg/followers","following_url":"https://api.github.com/users/stepancheg/following{/other_user}","gists_url":"https://api.github.com/users/stepancheg/gists{/gist_id}","starred_url":"https://api.github.com/users/stepancheg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stepancheg/subscriptions","organizations_url":"https://api.github.com/users/stepancheg/orgs","repos_url":"https://api.github.com/users/stepancheg/repos","events_url":"https://api.github.com/users/stepancheg/events{/privacy}","received_events_url":"https://api.github.com/users/stepancheg/received_events","type":"User","site_admin":false},"created_at":"2018-06-09T01:28:10Z","updated_at":"2018-06-09T01:28:10Z","author_association":"OWNER","body":"> If you offer guidance on where we can place the FAQ\r\n\r\nI think `FAQ.md` in the root of the repository would be the right place.\r\n\r\n>  can submit some PRs for some of the questions that I've seen on the issues\r\n\r\nI'll appreciate that.\r\n\r\n> To close out my question, once I have a ProtobufResult, what do I do with it to convert it into my common::Organisation message?\r\n\r\nThe same thing you usually do with `Result`: call `.unwrap()` to panic on error or handle error gracefully:\r\n\r\n```\r\nmatch org.merge_from_bytes(...) {\r\n  Ok(..) => println!(\"hooray! parsed message is already in org variable\"),\r\n  Err(e) => { println!(\"I've got an error {:?}, e); return; }\r\n}\r\n```\r\n\r\nNote that `merge_from_bytes` doesn't check that all `required` fields are set when syntax is `proto2`. Nobody seem to use `required` fields, but anyway."}}
{"actor":{"display_login":"stepancheg"}}