Trait debian_packaging::repository::ReleaseReader[][src]

pub trait ReleaseReader: DataResolver + Sync {
Show 22 methods fn url(&self) -> Result<Url>;
fn root_relative_path(&self) -> &str;
fn release_file(&self) -> &ReleaseFile<'_>;
fn preferred_compression(&self) -> Compression;
fn set_preferred_compression(&mut self, compression: Compression); fn retrieve_checksum(&self) -> Result<ChecksumType> { ... }
fn classified_indices_entries(
        &self
    ) -> Result<Vec<ClassifiedReleaseFileEntry<'_>>> { ... }
fn packages_indices_entries(&self) -> Result<Vec<PackagesFileEntry<'_>>> { ... }
fn packages_indices_entries_preferred_compression(
        &self
    ) -> Result<Vec<PackagesFileEntry<'_>>> { ... }
fn contents_indices_entries(&self) -> Result<Vec<ContentsFileEntry<'_>>> { ... }
fn sources_indices_entries(&self) -> Result<Vec<SourcesFileEntry<'_>>> { ... }
fn sources_indices_entries_preferred_compression(
        &self
    ) -> Result<Vec<SourcesFileEntry<'_>>> { ... }
fn packages_entry(
        &self,
        component: &str,
        architecture: &str,
        is_installer: bool
    ) -> Result<PackagesFileEntry<'_>> { ... }
fn resolve_packages_from_entry<'entry, 'slf: 'entry, 'async_trait>(
        &'slf self,
        entry: &'entry PackagesFileEntry<'slf>
    ) -> Pin<Box<dyn Future<Output = Result<BinaryPackageList<'static>>> + Send + 'async_trait>>
    where
        'entry: 'async_trait,
        'slf: 'async_trait,
        Self: 'async_trait
, { ... }
fn resolve_packages<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        component: &'life1 str,
        arch: &'life2 str,
        is_installer: bool
    ) -> Pin<Box<dyn Future<Output = Result<BinaryPackageList<'static>>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        Self: 'async_trait
, { ... }
fn resolve_package_fetches<'life0, 'async_trait>(
        &'life0 self,
        packages_file_filter: Box<dyn Fn(PackagesFileEntry<'_>) -> bool + Send>,
        binary_package_filter: Box<dyn Fn(BinaryPackageControlFile<'_>) -> bool + Send>,
        threads: usize
    ) -> Pin<Box<dyn Future<Output = Result<Vec<BinaryPackageFetch<'_>>>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
, { ... }
fn sources_entry(&self, component: &str) -> Result<SourcesFileEntry<'_>> { ... }
fn resolve_sources_from_entry<'entry, 'slf: 'entry, 'async_trait>(
        &'slf self,
        entry: &'entry SourcesFileEntry<'slf>
    ) -> Pin<Box<dyn Future<Output = Result<DebianSourcePackageList<'static>>> + Send + 'async_trait>>
    where
        'entry: 'async_trait,
        'slf: 'async_trait,
        Self: 'async_trait
, { ... }
fn resolve_sources<'life0, 'life1, 'async_trait>(
        &'life0 self,
        component: &'life1 str
    ) -> Pin<Box<dyn Future<Output = Result<DebianSourcePackageList<'static>>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... }
fn resolve_source_fetches<'life0, 'async_trait>(
        &'life0 self,
        sources_file_filter: Box<dyn Fn(SourcesFileEntry<'_>) -> bool + Send>,
        source_package_filter: Box<dyn Fn(DebianSourceControlFile<'_>) -> bool + Send>,
        threads: usize
    ) -> Pin<Box<dyn Future<Output = Result<Vec<SourcePackageFetch<'_>>>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
, { ... }
fn contents_entry(
        &self,
        component: &str,
        architecture: &str,
        is_installer: bool
    ) -> Result<ContentsFileEntry<'_>> { ... }
fn resolve_contents<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        component: &'life1 str,
        architecture: &'life2 str,
        is_installer: bool
    ) -> Pin<Box<dyn Future<Output = Result<ContentsFile>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        Self: 'async_trait
, { ... }
}
Expand description

Provides a transport-agnostic mechanism for reading from a parsed [In]Release file.

Required methods

Obtain the base URL to which this instance is bound.

Obtain the path relative to the repository root this instance is bound to.

e.g. dists/bullseye.

Implementations must not return a string with a leading or trailing /.

Obtain the parsed [In]Release file from which this reader is derived.

Obtain the preferred compression format to retrieve index files in.

Set the preferred compression format for retrieved index files.

Index files are often published in multiple compression formats, including no compression. This function can be used to instruct the reader which compression format to prefer.

Provided methods

Obtain the checksum flavor of content to retrieve.

By default, this will prefer the strongest known checksum advertised in the release file.

Obtain ClassifiedReleaseFileEntry within the parsed Release file.

Obtain parsed Packages file entries within this Release file.

Only entries for the checksum as defined by Self::retrieve_checksum() are returned.

There may be multiple entries for a given logical Packages file corresponding to different compression formats. Use Self::packages_entry() to resolve the entry for the Packages file for the preferred configuration.

Like Self::packages_indices_entries() except it deduplicates entries.

If there are multiple entries for a Packages file with varying compression, the most preferred compression format is returned.

Resolve indices for Contents files.

Only entries for the checksum as defined by Self::retrieve_checksum() are returned.

Multiple entries for the same logical file with varying compression formats may be returned.

Resolve indices for Sources file.

Only entries for the checksum as defined by Self::retrieve_checksum() are returned.

Multiple entries for the same logical file with varying compression formats may be returned.

Like Self::sources_indices_entries except it deduplicates entries.

If there are multiple entries for a Sources file with varying compression, the most preferred compression format is returned.

fn packages_entry(
    &self,
    component: &str,
    architecture: &str,
    is_installer: bool
) -> Result<PackagesFileEntry<'_>>

Resolve a reference to a Packages file to fetch given search criteria.

This will find all entries defining the desired Packages file. It will filter through the ChecksumType as defined by Self::retrieve_checksum() and will prioritize the compression format according to Self::preferred_compression().

fn resolve_packages_from_entry<'entry, 'slf: 'entry, 'async_trait>(
    &'slf self,
    entry: &'entry PackagesFileEntry<'slf>
) -> Pin<Box<dyn Future<Output = Result<BinaryPackageList<'static>>> + Send + 'async_trait>> where
    'entry: 'async_trait,
    'slf: 'async_trait,
    Self: 'async_trait, 

Fetch and parse a Packages file described by a PackagesFileEntry.

Resolve packages given parameters to resolve a Packages file.

Retrieve fetch instructions for binary packages.

The caller can specify a filter function to choose which packages to retrieve. Filtering works in 2 stages.

First, packages_file_filter is called with each PackagesFileEntry defining a Packages* file. If the filter returns true, this list of packages will be retrieved and expanded.

Second, binary_package_filter is called for each binary package entry seen in parsed Packages* files. If the function returns true, this binary package will be retrieved.

The emitted values can be fed into RepositoryRootReader::fetch_binary_package_generic() and RepositoryRootReader::fetch_binary_package_deb_reader() to fetch the binary package content.

fn sources_entry(&self, component: &str) -> Result<SourcesFileEntry<'_>>

Resolve the SourcesFileEntry for a given component.

This returns the entry variant that is preferred given digest and compression settings. If no entry is found, DebianError::RepositoryReadSourcesIndicesEntryNotFound is returned.

fn resolve_sources_from_entry<'entry, 'slf: 'entry, 'async_trait>(
    &'slf self,
    entry: &'entry SourcesFileEntry<'slf>
) -> Pin<Box<dyn Future<Output = Result<DebianSourcePackageList<'static>>> + Send + 'async_trait>> where
    'entry: 'async_trait,
    'slf: 'async_trait,
    Self: 'async_trait, 

Fetch a Sources file and parse source package entries inside.

The file to fetch is specified from a SourcesFileEntry describing it.

Fetch a Sources file for the given component and parse source package entries inside.

This will call Self::sources_entry to resolve the SourcesFileEntry for the given component then will call Self::resolve_sources_from_entry to fetch and parse it.

Resolves SourcePackageFetch for describing files to fetch for source packages.

The caller specifies filter functions to choose which source packages’ files to retrieve. Filtering works in 2 stages.

First, sources_filter_filter is called with each SourcesFileEntry defining a Sources file. If the filter returns true, this list of packages will be retrieved and expanded.

Second, source_package_filter is called for each source package entry seen in parsed Sources files. If the function returns true, the instructions for fetching the files comprising this source package will returned.

The returned SourcePackageFetch can be fed into RepositoryRootReader::fetch_source_package_generic() to retrieve the file content.

fn contents_entry(
    &self,
    component: &str,
    architecture: &str,
    is_installer: bool
) -> Result<ContentsFileEntry<'_>>

Resolve a reference to a Contents file to fetch given search criteria.

This will attempt to find the entry for a Contents file given search criteria.

Implementors