Skip to main content

PackageRecord

Struct PackageRecord 

Source
pub struct PackageRecord { /* private fields */ }
Expand description

A transient view of one package record.

Implementations§

Source§

impl PackageRecord

Source

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.

Source

pub fn field(&self, name: &str) -> Option<ValueText>

Returns the last value whose field name exactly equals name.

Source

pub fn fields<'a>( &'a self, name: &'a str, ) -> impl Iterator<Item = ValueText> + 'a

Iterates over all values whose field names exactly equal name.

Source

pub fn all_fields(&self) -> impl Iterator<Item = Field> + '_

Iterates over all structurally valid DCF fields in source order.

Source

pub fn parsed_version(&self) -> Option<Result<Version, VersionParseError>>

Parses the last Version value, without inspecting any other field.

Source

pub fn relations(&self, name: &str) -> Option<RelationList>

Parses the last named field as a recoverable relation list.

Source

pub fn logical(&self, name: &str) -> Option<Result<Logical, LogicalParseError>>

Parses the last named field as an R logical scalar.

Source

pub fn urls(&self, name: &str) -> Option<UrlList>

Parses the last named field as a recoverable URL list.

Source

pub fn parsed_priority(&self) -> Option<Result<Priority, PriorityParseError>>

Parses the last Priority value.

Source

pub fn parsed_os_type(&self) -> Option<Result<OsType, OsTypeParseError>>

Parses the last OS_type value.

Source

pub fn parsed_depends(&self) -> Option<RelationList>

Parses the last Depends relation list.

Source

pub fn parsed_imports(&self) -> Option<RelationList>

Parses the last Imports relation list.

Source

pub fn parsed_suggests(&self) -> Option<RelationList>

Parses the last Suggests relation list.

Source

pub fn parsed_enhances(&self) -> Option<RelationList>

Parses the last Enhances relation list.

Source

pub fn parsed_linking_to(&self) -> Option<RelationList>

Parses the last LinkingTo relation list.

Source

pub fn parsed_needs_compilation( &self, ) -> Option<Result<Logical, LogicalParseError>>

Parses the last NeedsCompilation logical value.

Source

pub fn parsed_license_is_foss( &self, ) -> Option<Result<Logical, LogicalParseError>>

Parses the last License_is_FOSS logical value.

Source

pub fn parsed_license_restricts_use( &self, ) -> Option<Result<Logical, LogicalParseError>>

Parses the last License_restricts_use logical value.

Source

pub fn parsed_url(&self) -> Option<UrlList>

Parses the last URL value as a recoverable URL list.

Source§

impl PackageRecord

Source

pub fn package(&self) -> Option<ValueText>

Returns the last raw Package value.

Source

pub fn version(&self) -> Option<ValueText>

Returns the last raw Version value.

Source

pub fn priority(&self) -> Option<ValueText>

Returns the last raw Priority value.

Source

pub fn depends(&self) -> Option<ValueText>

Returns the last raw Depends value.

Source

pub fn imports(&self) -> Option<ValueText>

Returns the last raw Imports value.

Source

pub fn suggests(&self) -> Option<ValueText>

Returns the last raw Suggests value.

Source

pub fn enhances(&self) -> Option<ValueText>

Returns the last raw Enhances value.

Source

pub fn linking_to(&self) -> Option<ValueText>

Returns the last raw LinkingTo value.

Source

pub fn license(&self) -> Option<ValueText>

Returns the last raw License value.

Source

pub fn license_is_foss(&self) -> Option<ValueText>

Returns the last raw License_is_FOSS value.

Source

pub fn license_restricts_use(&self) -> Option<ValueText>

Returns the last raw License_restricts_use value.

Source

pub fn os_type(&self) -> Option<ValueText>

Returns the last raw OS_type value.

Source

pub fn archs(&self) -> Option<ValueText>

Returns the last raw Archs value.

Source

pub fn md5sum(&self) -> Option<ValueText>

Returns the last raw MD5sum value.

Source

pub fn needs_compilation(&self) -> Option<ValueText>

Returns the last raw NeedsCompilation value.

Source

pub fn built(&self) -> Option<ValueText>

Returns the last raw Built value.

Source

pub fn repository(&self) -> Option<ValueText>

Returns the last raw Repository value.

Source

pub fn path(&self) -> Option<ValueText>

Returns the last raw Path value.

Source

pub fn file(&self) -> Option<ValueText>

Returns the last raw File value.

Source

pub fn packaged(&self) -> Option<ValueText>

Returns the last raw Packaged value.

Source

pub fn date_publication(&self) -> Option<ValueText>

Returns the last raw Date/Publication value.

Source

pub fn title(&self) -> Option<ValueText>

Returns the last raw Title value.

Source

pub fn description(&self) -> Option<ValueText>

Returns the last raw Description value.

Source

pub fn author(&self) -> Option<ValueText>

Returns the last raw Author value.

Source

pub fn authors_at_r(&self) -> Option<ValueText>

Returns the last raw Authors@R value.

Source

pub fn maintainer(&self) -> Option<ValueText>

Returns the last raw Maintainer value.

Source

pub fn url(&self) -> Option<ValueText>

Returns the last raw URL value.

Source

pub fn bug_reports(&self) -> Option<ValueText>

Returns the last raw BugReports value.

Source

pub fn encoding(&self) -> Option<ValueText>

Returns the last raw Encoding value.

Source

pub fn roxygen_note(&self) -> Option<ValueText>

Returns the last raw RoxygenNote value.

Source

pub fn system_requirements(&self) -> Option<ValueText>

Returns the last raw SystemRequirements value.

Source

pub fn additional_repositories(&self) -> Option<ValueText>

Returns the last raw Additional_repositories value.

Trait Implementations§

Source§

impl Clone for PackageRecord

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PackageRecord

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for PackageRecord

Source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for PackageRecord

Source§

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

Converts to this type from the input type.
Source§

impl From<PackageRecord> for Description

Owned equivalent of the lossless borrowed conversion.

Source§

fn from(record: PackageRecord) -> Self

Converts to this type from the input type.
Source§

impl Hash for PackageRecord

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for PackageRecord

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for PackageRecord

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_from(description: &Description) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Description> for PackageRecord

Owned equivalent of the lossless borrowed conversion.

Source§

type Error = RecordConversionError

The type returned in the event of a conversion error.
Source§

fn try_from(description: Description) -> Result<Self, Self::Error>

Performs the conversion.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.