Struct tuf::repository::HttpRepository
[−]
[src]
pub struct HttpRepository<D> where
D: DataInterchange, { /* fields omitted */ }
A repository accessible over HTTP.
Methods
impl<D> HttpRepository<D> where
D: DataInterchange,
[src]
D: DataInterchange,
fn new(
url: Url,
client: Client,
user_agent_prefix: Option<String>,
metadata_prefix: Option<Vec<String>>
) -> Self
[src]
url: Url,
client: Client,
user_agent_prefix: Option<String>,
metadata_prefix: Option<Vec<String>>
) -> Self
Create a new repository with the given Url
and Client
.
Callers should include a custom User-Agent prefix to help maintainers of TUF repositories keep track of which client versions exist in the field.
The argument metadata_prefix
is used provide an alternate path where metadata is stored on
the repository. If None
, this defaults to /
. For example, if there is a TUF repository
at https://tuf.example.com/
, but all metadata is stored at /meta/
, then passing the
arg Some("meta".into())
would cause root.json
to be fetched from
https://tuf.example.com/meta/root.json
.
Trait Implementations
impl<D> Repository<D> for HttpRepository<D> where
D: DataInterchange,
[src]
D: DataInterchange,
type TargetRead = Response
The type returned when reading a target.
fn initialize(&mut self) -> Result<()>
[src]
Initialize the repository.
fn store_metadata<M>(
&mut self,
_: &Role,
_: &MetadataPath,
_: &MetadataVersion,
_: &SignedMetadata<D, M>
) -> Result<()> where
M: Metadata,
[src]
&mut self,
_: &Role,
_: &MetadataPath,
_: &MetadataVersion,
_: &SignedMetadata<D, M>
) -> Result<()> where
M: Metadata,
This always returns Err
as storing over HTTP is not yet supported.
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,
[src]
&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,
Fetch signed metadata.
fn store_target<R>(&mut self, _: R, _: &TargetPath) -> Result<()> where
R: Read,
[src]
R: Read,
This always returns Err
as storing over HTTP is not yet supported.
fn fetch_target(
&mut self,
target_path: &TargetPath,
target_description: &TargetDescription,
min_bytes_per_second: u32
) -> Result<SafeReader<Self::TargetRead>>
[src]
&mut self,
target_path: &TargetPath,
target_description: &TargetDescription,
min_bytes_per_second: u32
) -> Result<SafeReader<Self::TargetRead>>
Fetch the given target.
fn check<M>(role: &Role, meta_path: &MetadataPath) -> Result<()> where
M: Metadata,
[src]
M: Metadata,
Perform a sanity check that M
, Role
, and MetadataPath
all desrcribe the same entity.