pub struct BinaryPackageControlFile<'a> { /* private fields */ }Expand description
A Debian binary package control file/paragraph.
Binary package control files are defined by a single paragraph with well-defined fields. This type is a low-level wrapper around an inner ControlParagraph. Deref and DerefMut can be used to operate on the inner ControlParagraph. From and Into are implemented in both directions to enable cheap coercion between the types.
Binary package control paragraphs are seen in DEBIAN/control files. Variations
also exist in Packages files in repositories and elsewhere.
Fields annotated as mandatory in the Debian Policy Manual have getters that return Result and will error if a field is not present. Non-mandatory fields return Option. This enforcement can be bypassed by calling ControlParagraph::field().
Implementations
The Version field as its original string.
The Version field parsed into a PackageVersion.
The Architecture field.
The Maintainer field.
The Description field.
The Built-Using field.
The Depends field, parsed to a DependencyList.
The Recommends field, parsed to a DependencyList.
The Suggests field, parsed to a DependencyList.
The Enhances field, parsed to a DependencyList.
The Pre-Depends field, parsed to a DependencyList.
Obtain parsed values of all fields defining dependencies.
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.
Whether a named field is present in this paragraph.
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
Obtain the size in bytes of the .deb file. Read more
Obtains the binary digest of this file given a checksum flavor. Read more
Obtain the filename of this .deb. Read more
Obtain a BinaryPackageControlFile representing content for a Packages index file. Read more
type Target = ControlParagraph<'a>
type Target = ControlParagraph<'a>
The resulting type after dereferencing.
Performs the conversion.
Performs the conversion.
This method tests for self and other values to be equal, and is used
by ==. Read more
This method tests for !=.
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
Auto Trait Implementations
impl<'a> RefUnwindSafe for BinaryPackageControlFile<'a>
impl<'a> Send for BinaryPackageControlFile<'a>
impl<'a> Sync for BinaryPackageControlFile<'a>
impl<'a> Unpin for BinaryPackageControlFile<'a>
impl<'a> UnwindSafe for BinaryPackageControlFile<'a>
Blanket Implementations
Mutably borrows from an owned value. Read more
Compare self to key and return true if they are equal.
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