/// Any more calls will result in an error and have no effect.
/// If writing results in an error, the file and the writer
/// may remain in an invalid state and should not be used further.
/// Errors when the chunk at this index was already written.
Any more calls will result in an error and have no effect.
If writing results in an error, the file and the writer
may remain in an invalid state and should not be used further.
Errors when the chunk at this index was already written.
Any more calls will result in an error and have no effect . If writing results in an error the file and the writer may remain in an invalid state and should not be used further . Errors when the chunk at this index was already written .
fn write_chunk(&mut self, index_in_header_increasing_y: usize, chunk: Chunk) -> UnitResult {
        let header_chunk_indices = &mut self.chunk_indices_increasing_y[chunk.layer_index];
        if index_in_header_increasing_y >= header_chunk_indices.len() {
            return Err(Error::invalid("too large chunk index"));
        }
        let chunk_index_slot = &mut header_chunk_indices[index_in_header_increasing_y];
        if *chunk_index_slot != 0 {
            return Err(Error::invalid(format!("chunk at index {} is already written", index_in_header_increasing_y)));
        }
        *chunk_index_slot = usize_to_u64(self.byte_writer.byte_position());
        chunk.write(&mut self.byte_writer, self.header_count)?;
        Ok(())
    }
fn write_chunk ( & mut self , index_in_header_increasing_y : usize , chunk : Chunk ) -> UnitResult { let header_chunk_indices = & mut self . chunk_indices_increasing_y [ chunk . layer_index ] ; if index_in_header_increasing_y >= header_chunk_indices . len ( ) { return Err ( Error :: invalid ( " " ) ) ; } let chunk_index_slot = & mut header_chunk_indices [ index_in_header_increasing_y ] ; if * chunk_index_slot != 0 { return Err ( Error :: invalid ( format ! ( " " index_in_header_increasing_y ) ) ) ; } * chunk_index_slot = usize_to_u64 ( self . byte_writer . byte_position ( ) ) ; chunk . write ( & mut self . byte_writer , self . header_count ) ? ; Ok ( ( ) ) }
Any more calls will result in an error and have no effect.
Any more calls will result in an error and have no effect .
&mut self
index_in_header_increasing_y
usize
chunk
Chunk