pub struct Repository {Show 17 fields
pub enabled: Option<bool>,
pub types: HashSet<RepositoryType>,
pub uris: Vec<Url>,
pub suites: Vec<String>,
pub components: Option<Vec<String>>,
pub architectures: Option<Vec<String>>,
pub languages: Option<Vec<String>>,
pub targets: Option<Vec<String>>,
pub pdiffs: Option<bool>,
pub by_hash: Option<YesNoForce>,
pub allow_insecure: Option<bool>,
pub allow_weak: Option<bool>,
pub allow_downgrade_to_insecure: Option<bool>,
pub trusted: Option<bool>,
pub signature: Option<Signature>,
pub x_repolib_name: Option<String>,
pub description: Option<String>,
}Expand description
A structure representing APT repository as declared by DEB822 source file
According to sources.list(5) man pages, only four fields are mandatory:
Typeseitherdebor/anddeb-srcURIsto repositories holding valid APT structure (unclear if multiple are allowed)Suitesusually being distribution codenamesComponentmost of the timemain, but it’s a section of the repository
The manpage specifies following optional fields
Enabledis a yes/no field, default yesArchitecturesLanguagesTargetsPDiffsis a yes/no fieldBy-Hashis a yes/no/force fieldAllow-Insecureis a yes/no field, default noAllow-Weakis a yes/no field, default noAllow-Downgrade-To-Insecureis a yes/no field, default noTrustedus a yes/no fieldSigned-Byis either path to the key or PGP key blockCheck-Valid-Untilis a yes/no fieldValid-Until-MinValid-Until-MaxCheck-Dateis a yes/no fieldDate-Max-FutureInRelease-Pathrelative pathSnapshoteitherenableor a snapshot ID
The unit tests of APT use:
Description
The RepoLib tool uses:
X-Repolib-Nameidentifier for own reference, meaningless for APT
Note: Multivalues *-Add & *-Remove semantics aren’t supported.
Fields§
§enabled: Option<bool>If no (false) the repository is ignored by APT
types: HashSet<RepositoryType>The value RepositoryType::Binary (deb) or/and RepositoryType::Source (deb-src)
uris: Vec<Url>The address of the repository
suites: Vec<String>The distribution name as codename or suite type (like stable or testing)
components: Option<Vec<String>>(Optional) Section of the repository, usually main, contrib or non-free
return None if repository is Flat Repository Format (https://wiki.debian.org/DebianRepository/Format#Flat_Repository_Format)
architectures: Option<Vec<String>>(Optional) Architectures binaries from this repository run on
languages: Option<Vec<String>>(Optional) Translations support to download
targets: Option<Vec<String>>(Optional) Download targets to acquire from this source
pdiffs: Option<bool>(Optional) Controls if APT should try PDiffs instead of downloading indexes entirely; if not set defaults to configuration option Acquire::PDiffs
by_hash: Option<YesNoForce>(Optional) Controls if APT should try to acquire indexes via a URI constructed from a hashsum of the expected file
allow_insecure: Option<bool>(Optional) If yes circumvents parts of apt-secure, don’t thread lightly
allow_weak: Option<bool>(Optional) If yes circumvents parts of apt-secure, don’t thread lightly
allow_downgrade_to_insecure: Option<bool>(Optional) If yes circumvents parts of apt-secure, don’t thread lightly
trusted: Option<bool>(Optional) If set forces whether APT considers source as rusted or no (default not present is a third state)
signature: Option<Signature>(Optional) Contains either absolute path to GPG keyring or embedded GPG public key block, if not set APT uses all trusted keys; I can’t find example of using with fingerprints
x_repolib_name: Option<String>(Optional) Field ignored by APT but used by RepoLib to identify repositories, Ubuntu sources contain them
description: Option<String>(Optional) Field not present in the man page, but used in APT unit tests, potentially to hold the repository description
Implementations§
Source§impl Repository
impl Repository
Sourcepub fn suites(&self) -> &[String]
pub fn suites(&self) -> &[String]
Returns slice of strings containing suites for which this repository provides
Sourcepub fn types(&self) -> &HashSet<RepositoryType>
pub fn types(&self) -> &HashSet<RepositoryType>
Returns the repository types (deb/deb-src)
Sourcepub fn components(&self) -> Option<&[String]>
pub fn components(&self) -> Option<&[String]>
Returns the repository components
Sourcepub fn architectures(&self) -> &[String]
pub fn architectures(&self) -> &[String]
Returns the repository architectures
Trait Implementations§
Source§impl Clone for Repository
impl Clone for Repository
Source§fn clone(&self) -> Repository
fn clone(&self) -> Repository
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Repository
impl Debug for Repository
Source§impl Default for Repository
impl Default for Repository
Source§fn default() -> Repository
fn default() -> Repository
Source§impl From<&LegacyRepository> for Repository
impl From<&LegacyRepository> for Repository
Source§fn from(original: &LegacyRepository) -> Self
fn from(original: &LegacyRepository) -> Self
Source§impl From<&Repository> for LegacyRepositories
impl From<&Repository> for LegacyRepositories
Source§fn from(repo: &Repository) -> Self
fn from(repo: &Repository) -> Self
Convert a DEB822 Repository to legacy format lines. Since a Repository can have multiple types/uris/suites, this may produce multiple lines.
Source§impl From<LegacyRepository> for Repository
impl From<LegacyRepository> for Repository
Source§fn from(original: LegacyRepository) -> Self
fn from(original: LegacyRepository) -> Self
Source§impl<P: Deb822LikeParagraph> FromDeb822Paragraph<P> for Repository
impl<P: Deb822LikeParagraph> FromDeb822Paragraph<P> for Repository
Source§impl PartialEq for Repository
impl PartialEq for Repository
Source§fn eq(&self, other: &Repository) -> bool
fn eq(&self, other: &Repository) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for Repository
Source§impl<P: Deb822LikeParagraph> ToDeb822Paragraph<P> for Repository
impl<P: Deb822LikeParagraph> ToDeb822Paragraph<P> for Repository
Source§fn to_paragraph(&self) -> P
fn to_paragraph(&self) -> P
Source§fn update_paragraph(&self, para: &mut P)
fn update_paragraph(&self, para: &mut P)
Auto Trait Implementations§
impl Freeze for Repository
impl RefUnwindSafe for Repository
impl Send for Repository
impl Sync for Repository
impl Unpin for Repository
impl UnsafeUnpin for Repository
impl UnwindSafe for Repository
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more