pub struct HttpRepositoryBuilder<C, D>{ /* private fields */ }Expand description
A builder to create a repository accessible over HTTP.
Implementations§
Source§impl<C, D> HttpRepositoryBuilder<C, D>
impl<C, D> HttpRepositoryBuilder<C, D>
Sourcepub fn new(url: Url, client: Client<C>) -> Self
pub fn new(url: Url, client: Client<C>) -> Self
Create a new repository with the given Url and Client.
Sourcepub fn new_with_uri(uri: Uri, client: Client<C>) -> Self
pub fn new_with_uri(uri: Uri, client: Client<C>) -> Self
Create a new repository with the given Url and Client.
Sourcepub fn user_agent<T: Into<String>>(self, user_agent: T) -> Self
pub fn user_agent<T: Into<String>>(self, user_agent: T) -> Self
Set the User-Agent prefix.
Callers should include a custom User-Agent prefix to help maintainers of TUF repositories keep track of which client versions exist in the field.
Sourcepub fn metadata_prefix(self, metadata_prefix: Vec<String>) -> Self
pub fn metadata_prefix(self, metadata_prefix: Vec<String>) -> Self
The argument metadata_prefix is used to 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.
Sourcepub fn targets_prefix(self, targets_prefix: Vec<String>) -> Self
pub fn targets_prefix(self, targets_prefix: Vec<String>) -> Self
The argument targets_prefix is used to provide an alternate path where targets 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 targets are stored at /targets/, then
passing the arg Some("targets".into()) would cause hello-world to be fetched from
https://tuf.example.com/targets/hello-world.
Sourcepub fn min_bytes_per_second(self, min: u32) -> Self
pub fn min_bytes_per_second(self, min: u32) -> Self
Set the minimum bytes per second for a read to be considered good.
Sourcepub fn build(self) -> HttpRepository<C, D>
pub fn build(self) -> HttpRepository<C, D>
Build a HttpRepository.