pub struct Distro {
pub url: String,
pub name: Option<String>,
pub path: Option<String>,
pub key: Key,
}
Expand description
The Distro groups all information required to locate the distribution main index InRelease file.
The struct can handle flat and default repositories. In case of a flat repository the name is None and the path is used. In case of a default repository the path is None and the name is used.
If name and path are none, the struct is invalid.
If a flat repo which makes not use of a subfolder, e.g. Suse Open Build Service, the path ./ can be used, like in apt source lists.
Fields§
§url: String
§name: Option<String>
§path: Option<String>
§key: Key
Implementations§
Source§impl Distro
impl Distro
Sourcepub fn repo(url: &str, name: &str, key: Key) -> Distro
pub fn repo(url: &str, name: &str, key: Key) -> Distro
Create a new default repo location description.
Sourcepub fn flat_repo(url: &str, directory: &str, key: Key) -> Distro
pub fn flat_repo(url: &str, directory: &str, key: Key) -> Distro
Create a new flat repo location description.
Sourcepub fn in_release_url(&self) -> Result<String>
pub fn in_release_url(&self) -> Result<String>
Get the URL of the InRelease index file.
Returns an error if name and path are None.
Sourcepub fn url(&self, path: &str, package: bool) -> String
pub fn url(&self, path: &str, package: bool) -> String
Create a URL using the given path.
This method can be used to get valid index urls when the package flag is false. In this case, the location of the InRelease file is used as a base.
This method can be used to get valid package urls when the package flag is true. In this case, the root location is used as a base.