add field borrow methods for CompressibleChunkStorage
@@ -40,15 +40,18 @@ pub type CompressedChunks<Compr> = Slab<Compressed<Compr>>;
impl<N, Compr> CompressibleChunkStorage<N, Compr>
where
- PointN<N>: Hash + IntegerPoint<N>,
Compr: Compression,
{
- pub fn new(compression: Compr) -> Self {
- Self {
- cache: SmallKeyLruCache::default(),
- compression,
- compressed: Slab::new(),
+ pub fn cache(&self) -> &SmallKeyLruCache<PointN<N>, Compr::Data, CompressedLocation> {
+ &self.cache
+ }
+
+ pub fn compression(&self) -> &Compr {
+ &self.compression
}
+
+ pub fn compressed(&self) -> &CompressedChunks<Compr> {
+ &self.compressed
}
}
@@ -57,6 +60,14 @@ where
PointN<N>: Hash + IntegerPoint<N>,
Compr: Compression,
{
+ pub fn new(compression: Compr) -> Self {
+ Self {
+ cache: SmallKeyLruCache::default(),
+ compression,
+ compressed: Slab::new(),
+ }
+ }
+
/// Returns a reader that implements `ChunkReadStorage`.
pub fn reader<'a>(
&'a self,
