pub struct PackageRecord { /* private fields */ }Expand description
A transient view of one package record.
Implementations§
Source§impl PackageRecord
impl PackageRecord
Sourcepub fn builder(
package: &str,
version: &str,
) -> Result<RecordBuilder, BuildError>
pub fn builder( package: &str, version: &str, ) -> Result<RecordBuilder, BuildError>
Starts a standalone record builder with checked initial identity fields.
§Errors
Returns an error for an invalid package name or version.
Sourcepub fn field(&self, name: &str) -> Option<ValueText>
pub fn field(&self, name: &str) -> Option<ValueText>
Returns the last value whose field name exactly equals name.
Sourcepub fn fields<'a>(
&'a self,
name: &'a str,
) -> impl Iterator<Item = ValueText> + 'a
pub fn fields<'a>( &'a self, name: &'a str, ) -> impl Iterator<Item = ValueText> + 'a
Iterates over all values whose field names exactly equal name.
Sourcepub fn all_fields(&self) -> impl Iterator<Item = Field> + '_
pub fn all_fields(&self) -> impl Iterator<Item = Field> + '_
Iterates over all structurally valid DCF fields in source order.
Sourcepub fn parsed_version(&self) -> Option<Result<Version, VersionParseError>>
pub fn parsed_version(&self) -> Option<Result<Version, VersionParseError>>
Parses the last Version value, without inspecting any other field.
Sourcepub fn relations(&self, name: &str) -> Option<RelationList>
pub fn relations(&self, name: &str) -> Option<RelationList>
Parses the last named field as a recoverable relation list.
Sourcepub fn logical(&self, name: &str) -> Option<Result<Logical, LogicalParseError>>
pub fn logical(&self, name: &str) -> Option<Result<Logical, LogicalParseError>>
Parses the last named field as an R logical scalar.
Sourcepub fn urls(&self, name: &str) -> Option<UrlList>
pub fn urls(&self, name: &str) -> Option<UrlList>
Parses the last named field as a recoverable URL list.
Sourcepub fn parsed_priority(&self) -> Option<Result<Priority, PriorityParseError>>
pub fn parsed_priority(&self) -> Option<Result<Priority, PriorityParseError>>
Parses the last Priority value.
Sourcepub fn parsed_os_type(&self) -> Option<Result<OsType, OsTypeParseError>>
pub fn parsed_os_type(&self) -> Option<Result<OsType, OsTypeParseError>>
Parses the last OS_type value.
Sourcepub fn parsed_depends(&self) -> Option<RelationList>
pub fn parsed_depends(&self) -> Option<RelationList>
Parses the last Depends relation list.
Sourcepub fn parsed_imports(&self) -> Option<RelationList>
pub fn parsed_imports(&self) -> Option<RelationList>
Parses the last Imports relation list.
Sourcepub fn parsed_suggests(&self) -> Option<RelationList>
pub fn parsed_suggests(&self) -> Option<RelationList>
Parses the last Suggests relation list.
Sourcepub fn parsed_enhances(&self) -> Option<RelationList>
pub fn parsed_enhances(&self) -> Option<RelationList>
Parses the last Enhances relation list.
Sourcepub fn parsed_linking_to(&self) -> Option<RelationList>
pub fn parsed_linking_to(&self) -> Option<RelationList>
Parses the last LinkingTo relation list.
Sourcepub fn parsed_needs_compilation(
&self,
) -> Option<Result<Logical, LogicalParseError>>
pub fn parsed_needs_compilation( &self, ) -> Option<Result<Logical, LogicalParseError>>
Parses the last NeedsCompilation logical value.
Sourcepub fn parsed_license_is_foss(
&self,
) -> Option<Result<Logical, LogicalParseError>>
pub fn parsed_license_is_foss( &self, ) -> Option<Result<Logical, LogicalParseError>>
Parses the last License_is_FOSS logical value.
Sourcepub fn parsed_license_restricts_use(
&self,
) -> Option<Result<Logical, LogicalParseError>>
pub fn parsed_license_restricts_use( &self, ) -> Option<Result<Logical, LogicalParseError>>
Parses the last License_restricts_use logical value.
Sourcepub fn parsed_url(&self) -> Option<UrlList>
pub fn parsed_url(&self) -> Option<UrlList>
Parses the last URL value as a recoverable URL list.
Source§impl PackageRecord
impl PackageRecord
Sourcepub fn linking_to(&self) -> Option<ValueText>
pub fn linking_to(&self) -> Option<ValueText>
Returns the last raw LinkingTo value.
Sourcepub fn license_is_foss(&self) -> Option<ValueText>
pub fn license_is_foss(&self) -> Option<ValueText>
Returns the last raw License_is_FOSS value.
Sourcepub fn license_restricts_use(&self) -> Option<ValueText>
pub fn license_restricts_use(&self) -> Option<ValueText>
Returns the last raw License_restricts_use value.
Sourcepub fn needs_compilation(&self) -> Option<ValueText>
pub fn needs_compilation(&self) -> Option<ValueText>
Returns the last raw NeedsCompilation value.
Sourcepub fn repository(&self) -> Option<ValueText>
pub fn repository(&self) -> Option<ValueText>
Returns the last raw Repository value.
Sourcepub fn date_publication(&self) -> Option<ValueText>
pub fn date_publication(&self) -> Option<ValueText>
Returns the last raw Date/Publication value.
Sourcepub fn description(&self) -> Option<ValueText>
pub fn description(&self) -> Option<ValueText>
Returns the last raw Description value.
Returns the last raw Author value.
Returns the last raw Authors@R value.
Sourcepub fn maintainer(&self) -> Option<ValueText>
pub fn maintainer(&self) -> Option<ValueText>
Returns the last raw Maintainer value.
Sourcepub fn bug_reports(&self) -> Option<ValueText>
pub fn bug_reports(&self) -> Option<ValueText>
Returns the last raw BugReports value.
Sourcepub fn roxygen_note(&self) -> Option<ValueText>
pub fn roxygen_note(&self) -> Option<ValueText>
Returns the last raw RoxygenNote value.
Sourcepub fn system_requirements(&self) -> Option<ValueText>
pub fn system_requirements(&self) -> Option<ValueText>
Returns the last raw SystemRequirements value.
Sourcepub fn additional_repositories(&self) -> Option<ValueText>
pub fn additional_repositories(&self) -> Option<ValueText>
Returns the last raw Additional_repositories value.
Trait Implementations§
Source§impl Clone for PackageRecord
impl Clone for PackageRecord
Source§impl Debug for PackageRecord
impl Debug for PackageRecord
Source§impl Display for PackageRecord
impl Display for PackageRecord
impl Eq for PackageRecord
Source§impl From<&PackageRecord> for Description
Converts the exact record text into a standalone DESCRIPTION document.
impl From<&PackageRecord> for Description
Converts the exact record text into a standalone DESCRIPTION document.
All fields (including custom fields and duplicates), their order, and malformed text are retained. Lookup remains case-sensitive and last-declaration-wins. No semantic validation is performed and no missing metadata is invented.
Record-local spacing, continuation indentation, line endings, and the presence or absence of a final newline are preserved. Surrounding blank lines and record separators are document-level text and are not included. Syntax diagnostics are recomputed relative to the standalone document.
Source§fn from(record: &PackageRecord) -> Self
fn from(record: &PackageRecord) -> Self
Source§impl From<PackageRecord> for Description
Owned equivalent of the lossless borrowed conversion.
impl From<PackageRecord> for Description
Owned equivalent of the lossless borrowed conversion.
Source§fn from(record: PackageRecord) -> Self
fn from(record: PackageRecord) -> Self
Source§impl Hash for PackageRecord
impl Hash for PackageRecord
Source§impl PartialEq for PackageRecord
impl PartialEq for PackageRecord
impl StructuralPartialEq for PackageRecord
Source§impl TryFrom<&Description> for PackageRecord
Converts a DESCRIPTION containing exactly one record into a package record.
impl TryFrom<&Description> for PackageRecord
Converts a DESCRIPTION containing exactly one record into a package record.
The existing syntax record is retained, including unknown fields, duplicate declarations, malformed text, and exact record-local formatting. No semantic validation is performed: missing identity fields and invalid field values are accepted. Lookup remains case-sensitive and last-declaration-wins. Surrounding document-level blank lines are not part of the returned record.
Empty/blank documents return RecordConversionError::NoRecords; documents
with multiple records return RecordConversionError::MultipleRecords.
Source§type Error = RecordConversionError
type Error = RecordConversionError
Source§impl TryFrom<Description> for PackageRecord
Owned equivalent of the lossless borrowed conversion.
impl TryFrom<Description> for PackageRecord
Owned equivalent of the lossless borrowed conversion.