Struct debian_packaging::repository::release::ReleaseFile [−][src]
pub struct ReleaseFile<'a> { /* fields omitted */ }Expand description
A Debian repository Release file.
Release files contain metadata and list the index files for a repository. They are effectively the entrypoint for defining a Debian repository and its content.
Instances are wrappers around a ControlParagraph. Deref and DerefMut are implemented to allow obtaining the inner ControlParagraph. From and Into are implemented to allow cheap type coercions. Note that converting from ReleaseFile to ControlParagraph may discard PGP cleartext signature data.
Implementations
Construct an instance by reading data from a reader.
The source must be a Debian control file with exactly 1 paragraph.
The source must not be PGP armored. i.e. do not feed it raw InRelease
files that begin with -----BEGIN PGP SIGNED MESSAGE-----.
Construct an instance by reading data from a reader containing a PGP cleartext signature.
This can be used to parse content from an InRelease file, which begins
with -----BEGIN PGP SIGNED MESSAGE-----.
An error occurs if the PGP cleartext file is not well-formed or if a PGP parsing error occurs.
The PGP signature is NOT validated. The file will be parsed despite lack of signature verification. This is conceptually insecure. But since Rust has memory safety, some risk is prevented.
Obtain PGP signatures from this InRelease file.
Description of this repository.
Version of this repository.
Typically a sequence of . delimited integers.
Suite of this repository.
e.g. stable, unstable, experimental.
Names of components within this repository.
These are areas within the repository. Values may contain path characters.
e.g. main, updates/main.
Debian machine architectures supported by this repository.
e.g. all, amd64, arm64.
Time the release file was created, as its raw string value.
Time the release file was created, as a DateTime.
The timezone from the original file is always normalized to UTC.
Time the release file should be considered expired by the client, as its raw string value.
Time the release file should be considered expired by the client.
Evaluated value for NotAutomatic field.
true is returned iff the value is yes. no and other values result in false.
Evaluated value for ButAutomaticUpgrades field.
true is returned iff the value is yes. no and other values result in false.
Whether to acquire files by hash.
pub fn iter_index_files(
&self,
checksum: ChecksumType
) -> Option<Box<dyn Iterator<Item = Result<ReleaseFileEntry<'_>>>>>
pub fn iter_index_files(
&self,
checksum: ChecksumType
) -> Option<Box<dyn Iterator<Item = Result<ReleaseFileEntry<'_>>>>>
Obtain indexed files in this repository.
Files are grouped by their checksum variant.
If the specified checksum variant is present, Some is returned.
The returned iterator emits ReleaseFileEntry instances. Entries are lazily parsed as they are consumed from the iterator. Parse errors result in an Err.
pub fn iter_classified_index_files(
&self,
checksum: ChecksumType
) -> Option<Box<dyn Iterator<Item = Result<ClassifiedReleaseFileEntry<'_>>>>>
pub fn iter_classified_index_files(
&self,
checksum: ChecksumType
) -> Option<Box<dyn Iterator<Item = Result<ClassifiedReleaseFileEntry<'_>>>>>
Obtain indexed files in this repository classified to their type.
This is like Self::iter_index_files() except it attempts classify each ReleaseFileEntry into a well-defined file type, returning a ClassifiedReleaseFileEntry.
If an entry doesn’t map to a more well-defined type, ClassifiedReleaseFileEntry::Other will be emitted. If an error occurs when coercing an entry to its stronger type, Err will be emitted instead of ClassifiedReleaseFileEntry::Other.
pub fn iter_contents_indices(
&self,
checksum: ChecksumType
) -> Option<Box<dyn Iterator<Item = Result<ContentsFileEntry<'_>>>>>
pub fn iter_contents_indices(
&self,
checksum: ChecksumType
) -> Option<Box<dyn Iterator<Item = Result<ContentsFileEntry<'_>>>>>
Obtain Contents indices entries given a checksum flavor.
This essentially looks for Contents* files in the file lists.
The emitted entries have component and architecture values derived by the file paths. These values are not checked against the list of components and architectures defined by this file.
pub fn iter_packages_indices(
&self,
checksum: ChecksumType
) -> Option<Box<dyn Iterator<Item = Result<PackagesFileEntry<'_>>>>>
pub fn iter_packages_indices(
&self,
checksum: ChecksumType
) -> Option<Box<dyn Iterator<Item = Result<PackagesFileEntry<'_>>>>>
Obtain Packages indices entries given a checksum flavor.
This essentially looks for Packages* files in the file lists.
The emitted entries have component and architecture values derived by the file paths. These values are not checked against the list of components and architectures defined by this file.
pub fn find_packages_indices(
&self,
checksum: ChecksumType,
compression: Compression,
component: &str,
arch: &str,
is_installer: bool
) -> Option<PackagesFileEntry<'_>>
pub fn find_packages_indices(
&self,
checksum: ChecksumType,
compression: Compression,
component: &str,
arch: &str,
is_installer: bool
) -> Option<PackagesFileEntry<'_>>
Find a PackagesFileEntry given search constraints.
pub fn iter_sources_indices(
&self,
checksum: ChecksumType
) -> Option<Box<dyn Iterator<Item = Result<SourcesFileEntry<'_>>>>>
pub fn iter_sources_indices(
&self,
checksum: ChecksumType
) -> Option<Box<dyn Iterator<Item = Result<SourcesFileEntry<'_>>>>>
Obtain Sources indices entries given a checksum flavor.
This essentially looks for Sources* files in the file lists.
pub fn find_sources_indices(
&self,
checksum: ChecksumType,
compression: Compression,
component: &str
) -> Option<SourcesFileEntry<'_>>
pub fn find_sources_indices(
&self,
checksum: ChecksumType,
compression: Compression,
component: &str
) -> Option<SourcesFileEntry<'_>>
Find a SourcesFileEntry given search constraints.
Methods from Deref<Target = ControlParagraph<'a>>
Whether the paragraph is empty.
Empty is defined by the lack of any fields.
Set the value of a field via a ControlField.
If a field with the same name (case insensitive compare) already exists, the old value will be replaced by the incoming value.
Set the value of a field defined via strings.
If a field with the same name (case insensitive compare) already exists, the old value will be replaced by the incoming value.
Iterate over fields in this paragraph.
Iteration order is insertion order.
Obtain the field with a given name in this paragraph.
Obtain a mutable reference to the field with a given name.
Obtain the named field and error if it isn’t defined.
Obtain the raw string value of the named field.
Obtain the raw string value of the named field, erroring if the field is not present.
Obtain the value of a field, evaluated as a boolean.
The field is true iff its string value is yes.
Obtain the value of a field, evaluated as a u64.
Obtain the value of a field, parsed as a DependencyList.
Obtain the value of a field parsed as an RFC 5322 date string.
This will parse values like Sat, 09 Oct 2021 09:34:56 UTC.
The timezone is always normalized to UTC even if it is expressed differently in the source string.
Obtain the field with the given name as a ControlFieldValue::Simple, if possible.
Obtain the field with the given name as a ControlFieldValue::Folded.
Obtain the field with the given name as a ControlFieldValue::Multiline.
Obtain an iterator of words in the named field.
Obtain an iterator of lines in the named field.
Obtain an iterator of comma-delimited values in the named field.
Convert this paragraph to a HashMap.
Values will be the string normalization of the field value, including newlines and leading whitespace.
If a field occurs multiple times, its last value will be recorded in the returned map.
Serialize the paragraph to a writer.
A trailing newline is written as part of the final field. However, an extra newline is not present. So if serializing multiple paragraphs, an additional line break must be written to effectively terminate this paragraph if the writer is not at EOF.
Trait Implementations
type Target = ControlParagraph<'a>
type Target = ControlParagraph<'a>
The resulting type after dereferencing.
Performs the conversion.
Performs the conversion.
Auto Trait Implementations
impl<'a> RefUnwindSafe for ReleaseFile<'a>
impl<'a> Send for ReleaseFile<'a>
impl<'a> Sync for ReleaseFile<'a>
impl<'a> Unpin for ReleaseFile<'a>
impl<'a> UnwindSafe for ReleaseFile<'a>
Blanket Implementations
Mutably borrows from an owned value. Read more
pub fn vzip(self) -> V
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more
