pub fn add_chunk(&mut self, index: ChunkIndex, chunk: Chunk) -> Result<(), Chunk> {
        if self.chunks.contains_key(&index) {
            Err(chunk)
        } else {
            self.replace_chunk(index, chunk);
            Ok(())
        }
    }
/// Inserts the given chunk at the given position, if there wasn't a chunk
/// at that position before. In the latter case the given chunk is returned.
Inserts the given chunk at the given position, if there wasn't a chunk
at that position before. In the latter case the given chunk is returned.
Inserts the given chunk at the given position if there wasn ' t a chunk at that position before . In the latter case the given chunk is returned .
pub fn add_chunk(&mut self, index: ChunkIndex, chunk: Chunk) -> Result<(), Chunk> {
        if self.chunks.contains_key(&index) {
            Err(chunk)
        } else {
            self.replace_chunk(index, chunk);
            Ok(())
        }
    }
pub fn add_chunk ( & mut self , index : ChunkIndex , chunk : Chunk ) -> Result < ( ) , Chunk > { if self . chunks . contains_key ( & index ) { Err ( chunk ) } else { self . replace_chunk ( index , chunk ) ; Ok ( ( ) ) } }
Inserts the given chunk at the given position, if there wasn't a chunk
at that position before.
Inserts the given chunk at the given position if there wasn ' t a chunk at that position before .
&mut self
index
ChunkIndex
chunk
Chunk