pub trait DataResolver: Sync {
    fn get_path<'life0, 'life1, 'async_trait>(
        &'life0 self,
        path: &'life1 str
    ) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn AsyncRead + Send>>>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
; fn get_path_with_digest_verification<'life0, 'life1, 'async_trait>(
        &'life0 self,
        path: &'life1 str,
        expected_size: u64,
        expected_digest: ContentDigest
    ) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn AsyncRead + Send>>>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... }
fn get_path_decoded<'life0, 'life1, 'async_trait>(
        &'life0 self,
        path: &'life1 str,
        compression: Compression
    ) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn AsyncRead + Send>>>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... }
fn get_path_decoded_with_digest_verification<'life0, 'life1, 'async_trait>(
        &'life0 self,
        path: &'life1 str,
        compression: Compression,
        expected_size: u64,
        expected_digest: ContentDigest
    ) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn AsyncRead + Send>>>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... } }
Expand description

Generic mechanism for obtaining content at a given path.

This trait is used to define a generic mechanism for resolving content given a lookup key/path.

Implementations only need to implement get_path(). The other members have default implementations that should do the correct thing by default.

Required methods

Get the content of a relative path as an async reader.

This obtains a reader for path data and returns the raw data without any decoding applied.

Provided methods

Obtain a reader that performs content integrity checking.

Because content digests can only be computed once all content is read, the reader emits data as it is streaming but only compares the cryptographic digest once all data has been read. If there is a content digest mismatch, an error will be raised once the final byte is read.

Validation only occurs if the stream is read to completion. Failure to read the entire stream could result in reading of unexpected content.

Get the content of a relative path with decompression transparently applied.

Like Self::get_path_decoded() but also perform content integrity verification.

The digest is matched against the original fetched content, before decompression.

Implementors