fn from(gossip_chunk: GossipChunk) -> Self {
        let response = match gossip_chunk.artifact_chunk {
            Ok(artifact_chunk) => Some(Response::Chunk(artifact_chunk.into())),
            // Add additional cases as required.
            Err(_) => Some(Response::Error(pb::P2pError::NotFound as i32)),
        };
        Self {
            artifact_id: serialize(&gossip_chunk.artifact_id)
                .expect("Local value serialization should succeed"),
            chunk_id: gossip_chunk.chunk_id.get(),
            response,
            integrity_hash: serialize(&gossip_chunk.integrity_hash)
                .expect("Local value serialization should succeed"),
        }
    }
/// The function converts the given chunk into the Protobuf equivalent.
The function converts the given chunk into the Protobuf equivalent.
The function converts the given chunk into the Protobuf equivalent .
fn from(gossip_chunk: GossipChunk) -> Self {
        let response = match gossip_chunk.artifact_chunk {
            Ok(artifact_chunk) => Some(Response::Chunk(artifact_chunk.into())),
            // Add additional cases as required.
            Err(_) => Some(Response::Error(pb::P2pError::NotFound as i32)),
        };
        Self {
            artifact_id: serialize(&gossip_chunk.artifact_id)
                .expect("Local value serialization should succeed"),
            chunk_id: gossip_chunk.chunk_id.get(),
            response,
            integrity_hash: serialize(&gossip_chunk.integrity_hash)
                .expect("Local value serialization should succeed"),
        }
    }
fn from ( gossip_chunk : GossipChunk ) -> Self { let response = match gossip_chunk . artifact_chunk { Ok ( artifact_chunk ) => Some ( Response :: Chunk ( artifact_chunk . into ( ) ) ) , // Add additional cases as required. Err ( _ ) => Some ( Response :: Error ( pb :: P2pError :: NotFound as i32 ) ) , } ; Self { artifact_id : serialize ( & gossip_chunk . artifact_id ) . expect ( " " ) , chunk_id : gossip_chunk . chunk_id . get ( ) , response , integrity_hash : serialize ( & gossip_chunk . integrity_hash ) . expect ( " " ) , } }
The function converts the given chunk into the Protobuf equivalent.
The function converts the given chunk into the Protobuf equivalent .
gossip_chunk
GossipChunk
gossip_chunk
GossipChunk