pub trait RepositoryProvider<D>where
D: Pouf,{
// Required methods
fn fetch_metadata<'a>(
&'a self,
meta_path: &MetadataPath,
version: MetadataVersion,
) -> BoxFuture<'a, Result<Box<dyn AsyncRead + Send + Unpin + 'a>>>;
fn fetch_target<'a>(
&'a self,
target_path: &TargetPath,
) -> BoxFuture<'a, Result<Box<dyn AsyncRead + Send + Unpin + 'a>>>;
}Expand description
A readable TUF repository.
Required Methods§
Sourcefn fetch_metadata<'a>(
&'a self,
meta_path: &MetadataPath,
version: MetadataVersion,
) -> BoxFuture<'a, Result<Box<dyn AsyncRead + Send + Unpin + 'a>>>
fn fetch_metadata<'a>( &'a self, meta_path: &MetadataPath, version: MetadataVersion, ) -> BoxFuture<'a, Result<Box<dyn AsyncRead + Send + Unpin + 'a>>>
Fetch signed metadata identified by meta_path, version, and
D::extension().
Implementations may ignore max_length and hash_data as Client will verify
these constraints itself. However, it may be more efficient for an implementation to detect
invalid metadata and fail the fetch operation before streaming all of the bytes of the
metadata.
Sourcefn fetch_target<'a>(
&'a self,
target_path: &TargetPath,
) -> BoxFuture<'a, Result<Box<dyn AsyncRead + Send + Unpin + 'a>>>
fn fetch_target<'a>( &'a self, target_path: &TargetPath, ) -> BoxFuture<'a, Result<Box<dyn AsyncRead + Send + Unpin + 'a>>>
Fetch the given target.
Implementations may ignore the length and hashes fields in target_description as
Client will verify these constraints itself. However, it may be more efficient
for an implementation to detect invalid targets and fail the fetch operation before
streaming all of the bytes.