pub struct DebianSourceControlFile<'a> { /* private fields */ }
Expand description

A Debian source control file/paragraph.

This control file consists of a single paragraph and defines a source package. This paragraph is typically found in .dsc files and in Sources files in repositories.

The fields are defined at https://www.debian.org/doc/debian-policy/ch-controlfields.html#debian-source-control-files-dsc.

Implementations

Construct an instance by reading data from a reader.

The source must be a Debian source control file with exactly 1 paragraph.

The source must not be PGP armored (e.g. beginning with -----BEGIN PGP SIGNED MESSAGE-----). For PGP armored data, use Self::from_armored_reader().

Construct an instance by reading data from a reader containing a PGP cleartext signature.

This can be used to parse content from a .dsc 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.

Clone without preserving signatures data.

Obtain PGP signatures from this possibly signed file.

The binary packages this source package produces.

See https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-binary.

The architectures this source package will build for.

See https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-architecture.

The version number of the package as a string.

See https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-version.

The URL from which the source of this package can be obtained.

See https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-homepage.

Describes the Git source from which this package came.

See https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-dgit.

The most recent version of the standards this package conforms to.

See https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-standards-version.

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.

Packages that can be built from this source package.

See https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-package-list.

List of associated files with SHA-1 checksums.

See https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-checksums.

List of associated files with SHA-256 checksums.

See https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-checksums.

List of associated files with MD5 checksums.

See https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-files.

Obtain DebianSourceControlFileFetch for a given digest variant.

This obtains records that instruct how to fetch the files that compose this source package.

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

Returns the “default value” for a type. Read more

The resulting type after dereferencing.

Dereferences the value.

Mutably dereferences the value.

Converts to this type from the input type.

Converts to this type from the input type.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

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