aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2017-11-28 23:33:19 -0800
committerBryan Newbold <bnewbold@robocracy.org>2017-11-28 23:33:19 -0800
commitefc82f49b27b5e6eacf26566168e77395fb39d68 (patch)
tree0b5e2925a7d189fd3334103dc43a50ff6dfbdfc7 /src
parent1c56f3179c07be3b77353c3b3f6847a46a366e80 (diff)
downloadgeniza-efc82f49b27b5e6eacf26566168e77395fb39d68.tar.gz
geniza-efc82f49b27b5e6eacf26566168e77395fb39d68.zip
make more library things public
Diffstat (limited to 'src')
-rw-r--r--src/drive.rs6
-rw-r--r--src/protocol.rs4
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()?;