From a42c1e412ae141ec897ef50d7faf7b2c6d5f025c Mon Sep 17 00:00:00 2001 From: Thinkofname Date: Mon, 21 Mar 2016 14:05:13 +0000 Subject: [PATCH] Implement chunk loading --- protocol/src/types/bit/map.rs | 7 +++++++ protocol/src/types/nibble.rs | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/protocol/src/types/bit/map.rs b/protocol/src/types/bit/map.rs index a847bb3..ece65fd 100644 --- a/protocol/src/types/bit/map.rs +++ b/protocol/src/types/bit/map.rs @@ -59,6 +59,13 @@ impl Map { } map } + pub fn from_raw(bits: Vec, size: usize) -> Map { + Map { + length: (bits.len()*64 + 63) / size, + bit_size: size, + bits: bits, + } + } pub fn resize(&self, size: usize) -> Map { let mut n = Map::new(self.length, size); diff --git a/protocol/src/types/nibble.rs b/protocol/src/types/nibble.rs index 1b62d2e..91ecdc8 100644 --- a/protocol/src/types/nibble.rs +++ b/protocol/src/types/nibble.rs @@ -14,7 +14,7 @@ pub struct Array { - data: Vec, + pub data: Vec, } impl Array {