fn serve_chunk(&self, gossip_request: &GossipChunkRequest) -> P2PResult<ArtifactChunk> {
        self.artifact_manager
            .get_validated_by_identifier(&gossip_request.artifact_id)
            .ok_or_else(|| {
                self.metrics.chunk_req_not_found.inc();
                P2PError {
                    p2p_error_code: P2PErrorCode::NotFound,
                }
            })?
            .get_chunk(gossip_request.chunk_id)
            .ok_or_else(|| {
                self.metrics.chunk_req_not_found.inc();
                P2PError {
                    p2p_error_code: P2PErrorCode::NotFound,
                }
            })
    }
/// The method returns the artifact chunk matching the given chunk request
/// (if available).
The method returns the artifact chunk matching the given chunk request
(if available).
The method returns the artifact chunk matching the given chunk request ( if available ) .
fn serve_chunk(&self, gossip_request: &GossipChunkRequest) -> P2PResult<ArtifactChunk> {
        self.artifact_manager
            .get_validated_by_identifier(&gossip_request.artifact_id)
            .ok_or_else(|| {
                self.metrics.chunk_req_not_found.inc();
                P2PError {
                    p2p_error_code: P2PErrorCode::NotFound,
                }
            })?
            .get_chunk(gossip_request.chunk_id)
            .ok_or_else(|| {
                self.metrics.chunk_req_not_found.inc();
                P2PError {
                    p2p_error_code: P2PErrorCode::NotFound,
                }
            })
    }
fn serve_chunk ( & self , gossip_request : & GossipChunkRequest ) -> P2PResult < ArtifactChunk > { self . artifact_manager . get_validated_by_identifier ( & gossip_request . artifact_id ) . ok_or_else ( | | { self . metrics . chunk_req_not_found . inc ( ) ; P2PError { p2p_error_code : P2PErrorCode :: NotFound , } } ) ? . get_chunk ( gossip_request . chunk_id ) . ok_or_else ( | | { self . metrics . chunk_req_not_found . inc ( ) ; P2PError { p2p_error_code : P2PErrorCode :: NotFound , } } ) }
The method returns the artifact chunk matching the given chunk request
(if available).
The method returns the artifact chunk matching the given chunk request ( if available ) .
&self
gossip_request
&GossipChunkRequest
&self
gossip_request
&GossipChunkRequest