mithril_aggregator/
immutable_file_digest_mapper.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use std::collections::BTreeMap;

use async_trait::async_trait;

use mithril_common::{
    entities::{HexEncodedDigest, ImmutableFileName},
    StdResult,
};

/// A trait for mapping [ImmutableFileName]s to their digests.
#[cfg_attr(test, mockall::automock)]
#[async_trait]
pub trait ImmutableFileDigestMapper: Sync + Send {
    /// Associate each given [immutable files][ImmutableFileName] with a digest.
    async fn get_immutable_file_digest_map(
        &self,
    ) -> StdResult<BTreeMap<ImmutableFileName, HexEncodedDigest>>;
}