Trait tuf::repository::Repository [] [src]

pub trait Repository<D> where
    D: DataInterchange
{ type TargetRead: Read; fn initialize(&mut self) -> Result<()>;
fn store_metadata<M>(
        &mut self,
        role: &Role,
        meta_path: &MetadataPath,
        version: &MetadataVersion,
        metadata: &SignedMetadata<D, M>
    ) -> Result<()>
    where
        M: Metadata
;
fn fetch_metadata<M>(
        &mut self,
        role: &Role,
        meta_path: &MetadataPath,
        version: &MetadataVersion,
        max_size: &Option<usize>,
        min_bytes_per_second: u32,
        hash_data: Option<(&HashAlgorithm, HashValue)>
    ) -> Result<SignedMetadata<D, M>>
    where
        M: Metadata
;
fn store_target<R>(
        &mut self,
        read: R,
        target_path: &TargetPath
    ) -> Result<()>
    where
        R: Read
;
fn fetch_target(
        &mut self,
        target_path: &TargetPath,
        target_description: &TargetDescription,
        min_bytes_per_second: u32
    ) -> Result<SafeReader<Self::TargetRead>>; fn check<M>(role: &Role, meta_path: &MetadataPath) -> Result<()>
    where
        M: Metadata
, { ... } }

Top-level trait that represents a TUF repository and contains all the ways it can be interacted with.

Associated Types

The type returned when reading a target.

Required Methods

Initialize the repository.

Store signed metadata.

Note: This MUST canonicalize the bytes before storing them as a read will expect the hashes of the metadata to match.

Fetch signed metadata.

Store the given target.

Fetch the given target.

Provided Methods

Perform a sanity check that M, Role, and MetadataPath all desrcribe the same entity.

Implementors