/// Insert a compressed chunk. Returns the old chunk if one exists.
Insert a compressed chunk. Returns the old chunk if one exists.
Insert a compressed chunk . Returns the old chunk if one exists .
pub fn insert_compressed(
        &mut self,
        key: PointN<N>,
        compressed_chunk: Compressed<FastChunkCompression<N, T, Meta, B>>,
    ) -> Option<MaybeCompressedChunk<N, T, Meta, B>> {
        let compressed_entry = self.compressed.vacant_entry();
        let old_entry = self
            .cache
            .evict(key, CompressedLocation(compressed_entry.key()));
        compressed_entry.insert(compressed_chunk);
        old_entry.map(|entry| match entry {
            CacheEntry::Cached(chunk) => MaybeCompressedChunk::Decompressed(chunk),
            CacheEntry::Evicted(old_location) => {
                MaybeCompressedChunk::Compressed(self.compressed.remove(old_location.0))
            }
        })
    }
pub fn insert_compressed ( & mut self , key : PointN < N > , compressed_chunk : Compressed < FastChunkCompression < N , T , Meta , B > > , ) -> Option < MaybeCompressedChunk < N , T , Meta , B > > { let compressed_entry = self . compressed . vacant_entry ( ) ; let old_entry = self . cache . evict ( key , CompressedLocation ( compressed_entry . key ( ) ) ) ; compressed_entry . insert ( compressed_chunk ) ; old_entry . map ( | entry | match entry { CacheEntry :: Cached ( chunk ) => MaybeCompressedChunk :: Decompressed ( chunk ) , CacheEntry :: Evicted ( old_location ) => { MaybeCompressedChunk :: Compressed ( self . compressed . remove ( old_location . 0 ) ) } } ) }
Insert a compressed chunk.
Insert a compressed chunk .
&mut self
key
PointN<N>
compressed_chunk
Compressed<FastChunkCompression<N, T, Meta, B>>