pub struct RepoBuilder { /* private fields */ }Expand description
Builder-pattern API for constructing a Repo with a fluent interface.
Create a new builder with RepoBuilder::new or clone an existing repo
with RepoBuilder::from.
§Examples
use dnf_repofile::{RepoBuilder, RepoId, DnfBool};
let repo = RepoBuilder::new(RepoId::try_new("myrepo").unwrap())
.enabled(DnfBool::yes())
.build();Implementations§
Source§impl RepoBuilder
impl RepoBuilder
Sourcepub fn new(id: RepoId) -> Self
pub fn new(id: RepoId) -> Self
Create a new builder with the given repository ID.
All other fields are initialized to None or empty.
§Examples
use dnf_repofile::{RepoBuilder, RepoId};
let builder = RepoBuilder::new(RepoId::try_new("test").unwrap());Sourcepub fn baseurl(self, v: Url) -> Self
pub fn baseurl(self, v: Url) -> Self
Add a base URL to the repository.
Multiple URLs can be added by chaining this method.
Sourcepub fn baseurls(self, v: Vec<Url>) -> Self
pub fn baseurls(self, v: Vec<Url>) -> Self
Set all base URLs at once, replacing any existing URLs.
Sourcepub fn mirrorlist(self, v: Url) -> Self
pub fn mirrorlist(self, v: Url) -> Self
Set the mirror list URL.
Sourcepub fn gpgkey(self, v: &str) -> Self
pub fn gpgkey(self, v: &str) -> Self
Add a GPG key URL.
Multiple keys can be added by chaining this method.
Sourcepub fn gpgkeys(self, v: Vec<String>) -> Self
pub fn gpgkeys(self, v: Vec<String>) -> Self
Set all GPG key URLs at once, replacing any existing keys.
Sourcepub fn repo_gpgcheck(self, v: DnfBool) -> Self
pub fn repo_gpgcheck(self, v: DnfBool) -> Self
Set whether to GPG-check repository metadata.
Sourcepub fn priority(self, v: Priority) -> Self
pub fn priority(self, v: Priority) -> Self
Set the repository priority (1–99, lower = higher priority).
Sourcepub fn module_hotfixes(self, v: DnfBool) -> Self
pub fn module_hotfixes(self, v: DnfBool) -> Self
Mark the repository as a module hotfix repository.
Sourcepub fn metadata_type(self, v: RepoMetadataType) -> Self
pub fn metadata_type(self, v: RepoMetadataType) -> Self
Set the repository metadata type (e.g., rpm-md).
Sourcepub fn excludepkgs(self, v: &str) -> Self
pub fn excludepkgs(self, v: &str) -> Self
Add a package name glob to the exclude list.
Sourcepub fn includepkgs(self, v: &str) -> Self
pub fn includepkgs(self, v: &str) -> Self
Add a package name glob to the include list.
Set whether to skip the repository if it is unavailable.
Sourcepub fn timeout(self, v: TimeoutSeconds) -> Self
pub fn timeout(self, v: TimeoutSeconds) -> Self
Set the network timeout in seconds.
Sourcepub fn max_parallel_downloads(self, v: MaxParallelDownloads) -> Self
pub fn max_parallel_downloads(self, v: MaxParallelDownloads) -> Self
Set the maximum number of parallel downloads.
Sourcepub fn proxy(self, v: ProxySetting) -> Self
pub fn proxy(self, v: ProxySetting) -> Self
Set the proxy configuration.
Trait Implementations§
Source§impl Clone for RepoBuilder
impl Clone for RepoBuilder
Source§fn clone(&self) -> RepoBuilder
fn clone(&self) -> RepoBuilder
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more