/// The method adds the given chunk.
The method adds the given chunk.
The method adds the given chunk .
fn add_chunk(
            &mut self,
            artifact_chunk: ArtifactChunk,
        ) -> Result<Artifact, ArtifactErrorCode> {
            self.chunks.push(artifact_chunk.clone());
            if self.chunks.len() == self.num_chunks as usize {
                match artifact_chunk.artifact_chunk_data {
                    ArtifactChunkData::UnitChunkData(artifact) => Ok(artifact),
                    _ => Err(ArtifactErrorCode::ChunkVerificationFailed),
                }
            } else {
                Err(ArtifactErrorCode::ChunksMoreNeeded)
            }
        }
fn add_chunk ( & mut self , artifact_chunk : ArtifactChunk , ) -> Result < Artifact , ArtifactErrorCode > { self . chunks . push ( artifact_chunk . clone ( ) ) ; if self . chunks . len ( ) == self . num_chunks as usize { match artifact_chunk . artifact_chunk_data { ArtifactChunkData :: UnitChunkData ( artifact ) => Ok ( artifact ) , _ => Err ( ArtifactErrorCode :: ChunkVerificationFailed ) , } } else { Err ( ArtifactErrorCode :: ChunksMoreNeeded ) } }
The method adds the given chunk.
The method adds the given chunk .
&mut self
artifact_chunk
ArtifactChunk