aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/lib.rs4
-rw-r--r--src/metadata_msgs.proto (renamed from src/metadata_msg.proto)12
-rw-r--r--src/metadata_msgs.rs (renamed from src/metadata_msg.rs)427
-rw-r--r--src/network_msgs.proto2
-rw-r--r--src/network_msgs.rs (renamed from src/network_msg.rs)0
-rw-r--r--src/protocol.rs4
6 files changed, 396 insertions, 53 deletions
diff --git a/src/lib.rs b/src/lib.rs
index c09301b..ddd67d8 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -48,5 +48,5 @@ mod sleep_register;
pub use sleep_register::*;
mod protocol;
pub use protocol::*;
-pub mod network_msg;
-pub mod metadata_msg;
+pub mod network_msgs;
+pub mod metadata_msgs;
diff --git a/src/metadata_msg.proto b/src/metadata_msgs.proto
index 68d1f59..8de4949 100644
--- a/src/metadata_msg.proto
+++ b/src/metadata_msgs.proto
@@ -1,3 +1,5 @@
+syntax = "proto2";
+
// File copied from: https://github.com/mafintosh/hyperdrive/blob/master/lib/messages.js
// Copyright (c) 2015 Mathias Buus
// MIT License (MIT)
@@ -19,3 +21,13 @@ message Stat {
optional uint64 mtime = 8;
optional uint64 ctime = 9;
}
+
+// File copied from: https://github.com/mafintosh/append-tree/blob/master/schema.proto
+// Copyright (c) 2015 Mathias Buus
+// MIT License (MIT)
+
+message Node {
+ required string name = 1;
+ optional bytes value = 2;
+ optional bytes paths = 3;
+}
diff --git a/src/metadata_msg.rs b/src/metadata_msgs.rs
index c30833a..3df9a4d 100644
--- a/src/metadata_msg.rs
+++ b/src/metadata_msgs.rs
@@ -822,57 +822,386 @@ impl ::protobuf::reflect::ProtobufValue for Stat {
}
}
+#[derive(PartialEq,Clone,Default)]
+pub struct Node {
+ // message fields
+ name: ::protobuf::SingularField<::std::string::String>,
+ value: ::protobuf::SingularField<::std::vec::Vec<u8>>,
+ paths: ::protobuf::SingularField<::std::vec::Vec<u8>>,
+ // special fields
+ unknown_fields: ::protobuf::UnknownFields,
+ cached_size: ::protobuf::CachedSize,
+}
+
+// see codegen.rs for the explanation why impl Sync explicitly
+unsafe impl ::std::marker::Sync for Node {}
+
+impl Node {
+ pub fn new() -> Node {
+ ::std::default::Default::default()
+ }
+
+ pub fn default_instance() -> &'static Node {
+ static mut instance: ::protobuf::lazy::Lazy<Node> = ::protobuf::lazy::Lazy {
+ lock: ::protobuf::lazy::ONCE_INIT,
+ ptr: 0 as *const Node,
+ };
+ unsafe {
+ instance.get(Node::new)
+ }
+ }
+
+ // required string name = 1;
+
+ pub fn clear_name(&mut self) {
+ self.name.clear();
+ }
+
+ pub fn has_name(&self) -> bool {
+ self.name.is_some()
+ }
+
+ // Param is passed by value, moved
+ pub fn set_name(&mut self, v: ::std::string::String) {
+ self.name = ::protobuf::SingularField::some(v);
+ }
+
+ // Mutable pointer to the field.
+ // If field is not initialized, it is initialized with default value first.
+ pub fn mut_name(&mut self) -> &mut ::std::string::String {
+ if self.name.is_none() {
+ self.name.set_default();
+ }
+ self.name.as_mut().unwrap()
+ }
+
+ // Take field
+ pub fn take_name(&mut self) -> ::std::string::String {
+ self.name.take().unwrap_or_else(|| ::std::string::String::new())
+ }
+
+ pub fn get_name(&self) -> &str {
+ match self.name.as_ref() {
+ Some(v) => &v,
+ None => "",
+ }
+ }
+
+ fn get_name_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> {
+ &self.name
+ }
+
+ fn mut_name_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> {
+ &mut self.name
+ }
+
+ // optional bytes value = 2;
+
+ pub fn clear_value(&mut self) {
+ self.value.clear();
+ }
+
+ pub fn has_value(&self) -> bool {
+ self.value.is_some()
+ }
+
+ // Param is passed by value, moved
+ pub fn set_value(&mut self, v: ::std::vec::Vec<u8>) {
+ self.value = ::protobuf::SingularField::some(v);
+ }
+
+ // Mutable pointer to the field.
+ // If field is not initialized, it is initialized with default value first.
+ pub fn mut_value(&mut self) -> &mut ::std::vec::Vec<u8> {
+ if self.value.is_none() {
+ self.value.set_default();
+ }
+ self.value.as_mut().unwrap()
+ }
+
+ // Take field
+ pub fn take_value(&mut self) -> ::std::vec::Vec<u8> {
+ self.value.take().unwrap_or_else(|| ::std::vec::Vec::new())
+ }
+
+ pub fn get_value(&self) -> &[u8] {
+ match self.value.as_ref() {
+ Some(v) => &v,
+ None => &[],
+ }
+ }
+
+ fn get_value_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec<u8>> {
+ &self.value
+ }
+
+ fn mut_value_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec<u8>> {
+ &mut self.value
+ }
+
+ // optional bytes paths = 3;
+
+ pub fn clear_paths(&mut self) {
+ self.paths.clear();
+ }
+
+ pub fn has_paths(&self) -> bool {
+ self.paths.is_some()
+ }
+
+ // Param is passed by value, moved
+ pub fn set_paths(&mut self, v: ::std::vec::Vec<u8>) {
+ self.paths = ::protobuf::SingularField::some(v);
+ }
+
+ // Mutable pointer to the field.
+ // If field is not initialized, it is initialized with default value first.
+ pub fn mut_paths(&mut self) -> &mut ::std::vec::Vec<u8> {
+ if self.paths.is_none() {
+ self.paths.set_default();
+ }
+ self.paths.as_mut().unwrap()
+ }
+
+ // Take field
+ pub fn take_paths(&mut self) -> ::std::vec::Vec<u8> {
+ self.paths.take().unwrap_or_else(|| ::std::vec::Vec::new())
+ }
+
+ pub fn get_paths(&self) -> &[u8] {
+ match self.paths.as_ref() {
+ Some(v) => &v,
+ None => &[],
+ }
+ }
+
+ fn get_paths_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec<u8>> {
+ &self.paths
+ }
+
+ fn mut_paths_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec<u8>> {
+ &mut self.paths
+ }
+}
+
+impl ::protobuf::Message for Node {
+ fn is_initialized(&self) -> bool {
+ if self.name.is_none() {
+ return false;
+ }
+ true
+ }
+
+ fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> {
+ while !is.eof()? {
+ let (field_number, wire_type) = is.read_tag_unpack()?;
+ match field_number {
+ 1 => {
+ ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.name)?;
+ },
+ 2 => {
+ ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.value)?;
+ },
+ 3 => {
+ ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.paths)?;
+ },
+ _ => {
+ ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
+ },
+ };
+ }
+ ::std::result::Result::Ok(())
+ }
+
+ // Compute sizes of nested messages
+ #[allow(unused_variables)]
+ fn compute_size(&self) -> u32 {
+ let mut my_size = 0;
+ if let Some(ref v) = self.name.as_ref() {
+ my_size += ::protobuf::rt::string_size(1, &v);
+ }
+ if let Some(ref v) = self.value.as_ref() {
+ my_size += ::protobuf::rt::bytes_size(2, &v);
+ }
+ if let Some(ref v) = self.paths.as_ref() {
+ my_size += ::protobuf::rt::bytes_size(3, &v);
+ }
+ my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
+ self.cached_size.set(my_size);
+ my_size
+ }
+
+ fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> {
+ if let Some(ref v) = self.name.as_ref() {
+ os.write_string(1, &v)?;
+ }
+ if let Some(ref v) = self.value.as_ref() {
+ os.write_bytes(2, &v)?;
+ }
+ if let Some(ref v) = self.paths.as_ref() {
+ os.write_bytes(3, &v)?;
+ }
+ os.write_unknown_fields(self.get_unknown_fields())?;
+ ::std::result::Result::Ok(())
+ }
+
+ fn get_cached_size(&self) -> u32 {
+ self.cached_size.get()
+ }
+
+ fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
+ &self.unknown_fields
+ }
+
+ fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
+ &mut self.unknown_fields
+ }
+
+ fn as_any(&self) -> &::std::any::Any {
+ self as &::std::any::Any
+ }
+ fn as_any_mut(&mut self) -> &mut ::std::any::Any {
+ self as &mut ::std::any::Any
+ }
+ fn into_any(self: Box<Self>) -> ::std::boxed::Box<::std::any::Any> {
+ self
+ }
+
+ fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
+ ::protobuf::MessageStatic::descriptor_static(None::<Self>)
+ }
+}
+
+impl ::protobuf::MessageStatic for Node {
+ fn new() -> Node {
+ Node::new()
+ }
+
+ fn descriptor_static(_: ::std::option::Option<Node>) -> &'static ::protobuf::reflect::MessageDescriptor {
+ static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
+ lock: ::protobuf::lazy::ONCE_INIT,
+ ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
+ };
+ unsafe {
+ descriptor.get(|| {
+ let mut fields = ::std::vec::Vec::new();
+ fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
+ "name",
+ Node::get_name_for_reflect,
+ Node::mut_name_for_reflect,
+ ));
+ fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>(
+ "value",
+ Node::get_value_for_reflect,
+ Node::mut_value_for_reflect,
+ ));
+ fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>(
+ "paths",
+ Node::get_paths_for_reflect,
+ Node::mut_paths_for_reflect,
+ ));
+ ::protobuf::reflect::MessageDescriptor::new::<Node>(
+ "Node",
+ fields,
+ file_descriptor_proto()
+ )
+ })
+ }
+ }
+}
+
+impl ::protobuf::Clear for Node {
+ fn clear(&mut self) {
+ self.clear_name();
+ self.clear_value();
+ self.clear_paths();
+ self.unknown_fields.clear();
+ }
+}
+
+impl ::std::fmt::Debug for Node {
+ fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
+ ::protobuf::text_format::fmt(self, f)
+ }
+}
+
+impl ::protobuf::reflect::ProtobufValue for Node {
+ fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
+ ::protobuf::reflect::ProtobufValueRef::Message(self)
+ }
+}
+
static file_descriptor_proto_data: &'static [u8] = b"\
- \n\x10hyperdrive.proto\"5\n\x05Index\x12\x12\n\x04type\x18\x01\x20\x02(\
- \tR\x04type\x12\x18\n\x07content\x18\x02\x20\x01(\x0cR\x07content\"\xce\
- \x01\n\x04Stat\x12\x12\n\x04mode\x18\x01\x20\x02(\rR\x04mode\x12\x10\n\
- \x03uid\x18\x02\x20\x01(\rR\x03uid\x12\x10\n\x03gid\x18\x03\x20\x01(\rR\
- \x03gid\x12\x12\n\x04size\x18\x04\x20\x01(\x04R\x04size\x12\x16\n\x06blo\
- cks\x18\x05\x20\x01(\x04R\x06blocks\x12\x16\n\x06offset\x18\x06\x20\x01(\
- \x04R\x06offset\x12\x1e\n\nbyteOffset\x18\x07\x20\x01(\x04R\nbyteOffset\
+ \n\x13metadata_msgs.proto\"5\n\x05Index\x12\x12\n\x04type\x18\x01\x20\
+ \x02(\tR\x04type\x12\x18\n\x07content\x18\x02\x20\x01(\x0cR\x07content\"\
+ \xce\x01\n\x04Stat\x12\x12\n\x04mode\x18\x01\x20\x02(\rR\x04mode\x12\x10\
+ \n\x03uid\x18\x02\x20\x01(\rR\x03uid\x12\x10\n\x03gid\x18\x03\x20\x01(\r\
+ R\x03gid\x12\x12\n\x04size\x18\x04\x20\x01(\x04R\x04size\x12\x16\n\x06bl\
+ ocks\x18\x05\x20\x01(\x04R\x06blocks\x12\x16\n\x06offset\x18\x06\x20\x01\
+ (\x04R\x06offset\x12\x1e\n\nbyteOffset\x18\x07\x20\x01(\x04R\nbyteOffset\
\x12\x14\n\x05mtime\x18\x08\x20\x01(\x04R\x05mtime\x12\x14\n\x05ctime\
- \x18\t\x20\x01(\x04R\x05ctimeJ\xd2\x06\n\x06\x12\x04\x02\0\x11\x01\n-\n\
- \x02\x04\0\x12\x04\x02\0\x05\x012!\x20From\x20hyperdrive:lib/messages.js\
- \n\n\n\n\x03\x04\0\x01\x12\x03\x02\x08\r\n\x0b\n\x04\x04\0\x02\0\x12\x03\
- \x03\x02\x1b\n\x0c\n\x05\x04\0\x02\0\x04\x12\x03\x03\x02\n\n\x0c\n\x05\
- \x04\0\x02\0\x05\x12\x03\x03\x0b\x11\n\x0c\n\x05\x04\0\x02\0\x01\x12\x03\
- \x03\x12\x16\n\x0c\n\x05\x04\0\x02\0\x03\x12\x03\x03\x19\x1a\n\x0b\n\x04\
- \x04\0\x02\x01\x12\x03\x04\x02\x1d\n\x0c\n\x05\x04\0\x02\x01\x04\x12\x03\
- \x04\x02\n\n\x0c\n\x05\x04\0\x02\x01\x05\x12\x03\x04\x0b\x10\n\x0c\n\x05\
- \x04\0\x02\x01\x01\x12\x03\x04\x11\x18\n\x0c\n\x05\x04\0\x02\x01\x03\x12\
- \x03\x04\x1b\x1c\n\n\n\x02\x04\x01\x12\x04\x07\0\x11\x01\n\n\n\x03\x04\
- \x01\x01\x12\x03\x07\x08\x0c\n\x0b\n\x04\x04\x01\x02\0\x12\x03\x08\x02\
- \x1b\n\x0c\n\x05\x04\x01\x02\0\x04\x12\x03\x08\x02\n\n\x0c\n\x05\x04\x01\
- \x02\0\x05\x12\x03\x08\x0b\x11\n\x0c\n\x05\x04\x01\x02\0\x01\x12\x03\x08\
- \x12\x16\n\x0c\n\x05\x04\x01\x02\0\x03\x12\x03\x08\x19\x1a\n\x0b\n\x04\
- \x04\x01\x02\x01\x12\x03\t\x02\x1a\n\x0c\n\x05\x04\x01\x02\x01\x04\x12\
- \x03\t\x02\n\n\x0c\n\x05\x04\x01\x02\x01\x05\x12\x03\t\x0b\x11\n\x0c\n\
- \x05\x04\x01\x02\x01\x01\x12\x03\t\x12\x15\n\x0c\n\x05\x04\x01\x02\x01\
- \x03\x12\x03\t\x18\x19\n\x0b\n\x04\x04\x01\x02\x02\x12\x03\n\x02\x1a\n\
- \x0c\n\x05\x04\x01\x02\x02\x04\x12\x03\n\x02\n\n\x0c\n\x05\x04\x01\x02\
- \x02\x05\x12\x03\n\x0b\x11\n\x0c\n\x05\x04\x01\x02\x02\x01\x12\x03\n\x12\
- \x15\n\x0c\n\x05\x04\x01\x02\x02\x03\x12\x03\n\x18\x19\n\x0b\n\x04\x04\
- \x01\x02\x03\x12\x03\x0b\x02\x1b\n\x0c\n\x05\x04\x01\x02\x03\x04\x12\x03\
- \x0b\x02\n\n\x0c\n\x05\x04\x01\x02\x03\x05\x12\x03\x0b\x0b\x11\n\x0c\n\
- \x05\x04\x01\x02\x03\x01\x12\x03\x0b\x12\x16\n\x0c\n\x05\x04\x01\x02\x03\
- \x03\x12\x03\x0b\x19\x1a\n\x0b\n\x04\x04\x01\x02\x04\x12\x03\x0c\x02\x1d\
- \n\x0c\n\x05\x04\x01\x02\x04\x04\x12\x03\x0c\x02\n\n\x0c\n\x05\x04\x01\
- \x02\x04\x05\x12\x03\x0c\x0b\x11\n\x0c\n\x05\x04\x01\x02\x04\x01\x12\x03\
- \x0c\x12\x18\n\x0c\n\x05\x04\x01\x02\x04\x03\x12\x03\x0c\x1b\x1c\n\x0b\n\
- \x04\x04\x01\x02\x05\x12\x03\r\x02\x1d\n\x0c\n\x05\x04\x01\x02\x05\x04\
- \x12\x03\r\x02\n\n\x0c\n\x05\x04\x01\x02\x05\x05\x12\x03\r\x0b\x11\n\x0c\
- \n\x05\x04\x01\x02\x05\x01\x12\x03\r\x12\x18\n\x0c\n\x05\x04\x01\x02\x05\
- \x03\x12\x03\r\x1b\x1c\n\x0b\n\x04\x04\x01\x02\x06\x12\x03\x0e\x02!\n\
- \x0c\n\x05\x04\x01\x02\x06\x04\x12\x03\x0e\x02\n\n\x0c\n\x05\x04\x01\x02\
- \x06\x05\x12\x03\x0e\x0b\x11\n\x0c\n\x05\x04\x01\x02\x06\x01\x12\x03\x0e\
- \x12\x1c\n\x0c\n\x05\x04\x01\x02\x06\x03\x12\x03\x0e\x1f\x20\n\x0b\n\x04\
- \x04\x01\x02\x07\x12\x03\x0f\x02\x1c\n\x0c\n\x05\x04\x01\x02\x07\x04\x12\
- \x03\x0f\x02\n\n\x0c\n\x05\x04\x01\x02\x07\x05\x12\x03\x0f\x0b\x11\n\x0c\
- \n\x05\x04\x01\x02\x07\x01\x12\x03\x0f\x12\x17\n\x0c\n\x05\x04\x01\x02\
- \x07\x03\x12\x03\x0f\x1a\x1b\n\x0b\n\x04\x04\x01\x02\x08\x12\x03\x10\x02\
- \x1c\n\x0c\n\x05\x04\x01\x02\x08\x04\x12\x03\x10\x02\n\n\x0c\n\x05\x04\
- \x01\x02\x08\x05\x12\x03\x10\x0b\x11\n\x0c\n\x05\x04\x01\x02\x08\x01\x12\
- \x03\x10\x12\x17\n\x0c\n\x05\x04\x01\x02\x08\x03\x12\x03\x10\x1a\x1b\
+ \x18\t\x20\x01(\x04R\x05ctime\"F\n\x04Node\x12\x12\n\x04name\x18\x01\x20\
+ \x02(\tR\x04name\x12\x14\n\x05value\x18\x02\x20\x01(\x0cR\x05value\x12\
+ \x14\n\x05paths\x18\x03\x20\x01(\x0cR\x05pathsJ\xbc\n\n\x06\x12\x04\0\0\
+ \x20\x01\n\x08\n\x01\x0c\x12\x03\0\0\x12\n\x98\x01\n\x02\x04\0\x12\x04\
+ \x07\0\n\x012\x8b\x01\x20File\x20copied\x20from:\x20https://github.com/m\
+ afintosh/hyperdrive/blob/master/lib/messages.js\n\x20Copyright\x20(c)\
+ \x202015\x20Mathias\x20Buus\n\x20MIT\x20License\x20(MIT)\n\n\n\n\x03\x04\
+ \0\x01\x12\x03\x07\x08\r\n\x0b\n\x04\x04\0\x02\0\x12\x03\x08\x02\x1b\n\
+ \x0c\n\x05\x04\0\x02\0\x04\x12\x03\x08\x02\n\n\x0c\n\x05\x04\0\x02\0\x05\
+ \x12\x03\x08\x0b\x11\n\x0c\n\x05\x04\0\x02\0\x01\x12\x03\x08\x12\x16\n\
+ \x0c\n\x05\x04\0\x02\0\x03\x12\x03\x08\x19\x1a\n\x0b\n\x04\x04\0\x02\x01\
+ \x12\x03\t\x02\x1d\n\x0c\n\x05\x04\0\x02\x01\x04\x12\x03\t\x02\n\n\x0c\n\
+ \x05\x04\0\x02\x01\x05\x12\x03\t\x0b\x10\n\x0c\n\x05\x04\0\x02\x01\x01\
+ \x12\x03\t\x11\x18\n\x0c\n\x05\x04\0\x02\x01\x03\x12\x03\t\x1b\x1c\n\n\n\
+ \x02\x04\x01\x12\x04\x0c\0\x16\x01\n\n\n\x03\x04\x01\x01\x12\x03\x0c\x08\
+ \x0c\n\x0b\n\x04\x04\x01\x02\0\x12\x03\r\x02\x1b\n\x0c\n\x05\x04\x01\x02\
+ \0\x04\x12\x03\r\x02\n\n\x0c\n\x05\x04\x01\x02\0\x05\x12\x03\r\x0b\x11\n\
+ \x0c\n\x05\x04\x01\x02\0\x01\x12\x03\r\x12\x16\n\x0c\n\x05\x04\x01\x02\0\
+ \x03\x12\x03\r\x19\x1a\n\x0b\n\x04\x04\x01\x02\x01\x12\x03\x0e\x02\x1a\n\
+ \x0c\n\x05\x04\x01\x02\x01\x04\x12\x03\x0e\x02\n\n\x0c\n\x05\x04\x01\x02\
+ \x01\x05\x12\x03\x0e\x0b\x11\n\x0c\n\x05\x04\x01\x02\x01\x01\x12\x03\x0e\
+ \x12\x15\n\x0c\n\x05\x04\x01\x02\x01\x03\x12\x03\x0e\x18\x19\n\x0b\n\x04\
+ \x04\x01\x02\x02\x12\x03\x0f\x02\x1a\n\x0c\n\x05\x04\x01\x02\x02\x04\x12\
+ \x03\x0f\x02\n\n\x0c\n\x05\x04\x01\x02\x02\x05\x12\x03\x0f\x0b\x11\n\x0c\
+ \n\x05\x04\x01\x02\x02\x01\x12\x03\x0f\x12\x15\n\x0c\n\x05\x04\x01\x02\
+ \x02\x03\x12\x03\x0f\x18\x19\n\x0b\n\x04\x04\x01\x02\x03\x12\x03\x10\x02\
+ \x1b\n\x0c\n\x05\x04\x01\x02\x03\x04\x12\x03\x10\x02\n\n\x0c\n\x05\x04\
+ \x01\x02\x03\x05\x12\x03\x10\x0b\x11\n\x0c\n\x05\x04\x01\x02\x03\x01\x12\
+ \x03\x10\x12\x16\n\x0c\n\x05\x04\x01\x02\x03\x03\x12\x03\x10\x19\x1a\n\
+ \x0b\n\x04\x04\x01\x02\x04\x12\x03\x11\x02\x1d\n\x0c\n\x05\x04\x01\x02\
+ \x04\x04\x12\x03\x11\x02\n\n\x0c\n\x05\x04\x01\x02\x04\x05\x12\x03\x11\
+ \x0b\x11\n\x0c\n\x05\x04\x01\x02\x04\x01\x12\x03\x11\x12\x18\n\x0c\n\x05\
+ \x04\x01\x02\x04\x03\x12\x03\x11\x1b\x1c\n\x0b\n\x04\x04\x01\x02\x05\x12\
+ \x03\x12\x02\x1d\n\x0c\n\x05\x04\x01\x02\x05\x04\x12\x03\x12\x02\n\n\x0c\
+ \n\x05\x04\x01\x02\x05\x05\x12\x03\x12\x0b\x11\n\x0c\n\x05\x04\x01\x02\
+ \x05\x01\x12\x03\x12\x12\x18\n\x0c\n\x05\x04\x01\x02\x05\x03\x12\x03\x12\
+ \x1b\x1c\n\x0b\n\x04\x04\x01\x02\x06\x12\x03\x13\x02!\n\x0c\n\x05\x04\
+ \x01\x02\x06\x04\x12\x03\x13\x02\n\n\x0c\n\x05\x04\x01\x02\x06\x05\x12\
+ \x03\x13\x0b\x11\n\x0c\n\x05\x04\x01\x02\x06\x01\x12\x03\x13\x12\x1c\n\
+ \x0c\n\x05\x04\x01\x02\x06\x03\x12\x03\x13\x1f\x20\n\x0b\n\x04\x04\x01\
+ \x02\x07\x12\x03\x14\x02\x1c\n\x0c\n\x05\x04\x01\x02\x07\x04\x12\x03\x14\
+ \x02\n\n\x0c\n\x05\x04\x01\x02\x07\x05\x12\x03\x14\x0b\x11\n\x0c\n\x05\
+ \x04\x01\x02\x07\x01\x12\x03\x14\x12\x17\n\x0c\n\x05\x04\x01\x02\x07\x03\
+ \x12\x03\x14\x1a\x1b\n\x0b\n\x04\x04\x01\x02\x08\x12\x03\x15\x02\x1c\n\
+ \x0c\n\x05\x04\x01\x02\x08\x04\x12\x03\x15\x02\n\n\x0c\n\x05\x04\x01\x02\
+ \x08\x05\x12\x03\x15\x0b\x11\n\x0c\n\x05\x04\x01\x02\x08\x01\x12\x03\x15\
+ \x12\x17\n\x0c\n\x05\x04\x01\x02\x08\x03\x12\x03\x15\x1a\x1b\n\x96\x01\n\
+ \x02\x04\x02\x12\x04\x1c\0\x20\x012\x89\x01\x20File\x20copied\x20from:\
+ \x20https://github.com/mafintosh/append-tree/blob/master/schema.proto\n\
+ \x20Copyright\x20(c)\x202015\x20Mathias\x20Buus\n\x20MIT\x20License\x20(\
+ MIT)\n\n\n\n\x03\x04\x02\x01\x12\x03\x1c\x08\x0c\n\x0b\n\x04\x04\x02\x02\
+ \0\x12\x03\x1d\x02\x1b\n\x0c\n\x05\x04\x02\x02\0\x04\x12\x03\x1d\x02\n\n\
+ \x0c\n\x05\x04\x02\x02\0\x05\x12\x03\x1d\x0b\x11\n\x0c\n\x05\x04\x02\x02\
+ \0\x01\x12\x03\x1d\x12\x16\n\x0c\n\x05\x04\x02\x02\0\x03\x12\x03\x1d\x19\
+ \x1a\n\x0b\n\x04\x04\x02\x02\x01\x12\x03\x1e\x02\x1b\n\x0c\n\x05\x04\x02\
+ \x02\x01\x04\x12\x03\x1e\x02\n\n\x0c\n\x05\x04\x02\x02\x01\x05\x12\x03\
+ \x1e\x0b\x10\n\x0c\n\x05\x04\x02\x02\x01\x01\x12\x03\x1e\x11\x16\n\x0c\n\
+ \x05\x04\x02\x02\x01\x03\x12\x03\x1e\x19\x1a\n\x0b\n\x04\x04\x02\x02\x02\
+ \x12\x03\x1f\x02\x1b\n\x0c\n\x05\x04\x02\x02\x02\x04\x12\x03\x1f\x02\n\n\
+ \x0c\n\x05\x04\x02\x02\x02\x05\x12\x03\x1f\x0b\x10\n\x0c\n\x05\x04\x02\
+ \x02\x02\x01\x12\x03\x1f\x11\x16\n\x0c\n\x05\x04\x02\x02\x02\x03\x12\x03\
+ \x1f\x19\x1a\
";
static mut file_descriptor_proto_lazy: ::protobuf::lazy::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::lazy::Lazy {
diff --git a/src/network_msgs.proto b/src/network_msgs.proto
index 6ee2b31..8c2a639 100644
--- a/src/network_msgs.proto
+++ b/src/network_msgs.proto
@@ -1,3 +1,5 @@
+syntax = "proto2";
+
// File copied from: https://github.com/mafintosh/hypercore-protocol/blob/master/schema.proto
// Copyright (c) 2016 Mathias Buus
// MIT License (MIT)
diff --git a/src/network_msg.rs b/src/network_msgs.rs
index e9dae76..e9dae76 100644
--- a/src/network_msg.rs
+++ b/src/network_msgs.rs
diff --git a/src/protocol.rs b/src/protocol.rs
index aaad914..0e1a449 100644
--- a/src/protocol.rs
+++ b/src/protocol.rs
@@ -12,8 +12,8 @@ use protobuf::parse_from_bytes;
use integer_encoding::{VarIntReader, VarIntWriter};
use errors::*;
-use network_msg::*;
-use metadata_msg::Index;
+use network_msgs::*;
+use metadata_msgs::Index;
#[derive(Debug)]
pub enum DatNetMessage {