diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/drive.rs | 6 | ||||
-rw-r--r-- | src/protocol.rs | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/drive.rs b/src/drive.rs index 4a9cf93..7ec2288 100644 --- a/src/drive.rs +++ b/src/drive.rs @@ -15,8 +15,8 @@ use metadata_msgs::{Index, Stat, Node}; /// "Sort of" follows rust std::fs API for file system access. pub struct DatDrive { - metadata: SleepDirRegister, - content: SleepDirRegister, + pub metadata: SleepDirRegister, + pub content: SleepDirRegister, } impl DatDrive { @@ -178,7 +178,7 @@ impl<'a> DatDrive { /// Returns number of drive metadata entries (not including the first entry, which is the /// content register public key) - fn entry_count(&mut self) -> Result<u64> { + pub fn entry_count(&mut self) -> Result<u64> { Ok(self.metadata.len()? - 1) } diff --git a/src/protocol.rs b/src/protocol.rs index 5726efd..733477d 100644 --- a/src/protocol.rs +++ b/src/protocol.rs @@ -261,7 +261,7 @@ impl DatConnection { Ok(dc) } - fn send_msg(&mut self, dnm: &DatNetMessage, is_content: bool) -> Result<()> { + pub fn send_msg(&mut self, dnm: &DatNetMessage, is_content: bool) -> Result<()> { let header_int: u8 = (is_content as u8) << 4 | (msg_code(dnm) & 0x0F); let msg: &Message = msg_sugar(dnm); let total_message_size = (msg.compute_size() as usize) + 1; @@ -293,7 +293,7 @@ impl DatConnection { Ok(()) } - fn recv_msg(&mut self) -> Result<(bool, DatNetMessage)> { + pub fn recv_msg(&mut self) -> Result<(bool, DatNetMessage)> { let total_len: u64 = self.read_varint()?; let header: u8 = self.read_varint()?; |