pub async fn handle_request_artifact(
    mut p2p_client: Client,
    artifact_storage: ArtifactStorage,
    artifact_type: &ArtifactType,
    artifact_id: &str,
    channel: ResponseChannel<ArtifactResponse>,
) -> anyhow::Result<()> {
    debug!(
        "Handling request artifact: {:?}={:?}",
        artifact_type, artifact_id
    );
    let content = match artifact_type {
        ArtifactType::Artifact => get_artifact(artifact_storage, artifact_id)?,
    };

    p2p_client.respond_artifact(content, channel).await
}
/// Respond to a RequestArtifact event by getting the artifact
/// based on the provided artifact type and hash.
Respond to a RequestArtifact event by getting the artifact
based on the provided artifact type and hash.
Respond to a RequestArtifact event by getting the artifact based on the provided artifact type and hash .
pub async fn handle_request_artifact(
    mut p2p_client: Client,
    artifact_storage: ArtifactStorage,
    artifact_type: &ArtifactType,
    artifact_id: &str,
    channel: ResponseChannel<ArtifactResponse>,
) -> anyhow::Result<()> {
    debug!(
        "Handling request artifact: {:?}={:?}",
        artifact_type, artifact_id
    );
    let content = match artifact_type {
        ArtifactType::Artifact => get_artifact(artifact_storage, artifact_id)?,
    };
    p2p_client.respond_artifact(content, channel).await
}
pub async fn handle_request_artifact ( mut p2p_client : Client , artifact_storage : ArtifactStorage , artifact_type : & ArtifactType , artifact_id : & str , channel : ResponseChannel < ArtifactResponse > , ) -> anyhow :: Result < ( ) > { debug ! ( " " artifact_type artifact_id ) ; let content = match artifact_type { ArtifactType :: Artifact => get_artifact ( artifact_storage , artifact_id ) ? , } ; p2p_client . respond_artifact ( content , channel ) . await }
Respond to a RequestArtifact event by getting the artifact
based on the provided artifact type and hash.
Respond to a RequestArtifact event by getting the artifact based on the provided artifact type and hash .
p2p_client
Client
artifact_storage
ArtifactStorage
artifact_type
&ArtifactType
artifact_id
&str
channel
ResponseChannel<ArtifactResponse>
p2p_client
Client
artifact_storage
ArtifactStorage
artifact_type
&ArtifactType
artifact_id
&str
channel
ResponseChannel<ArtifactResponse>