[][src]Struct pkg_utils::PkgSpec

pub struct PkgSpec {
    pub name: String,
    pub arch: Option<String>,
    // some fields omitted
}

This is some package info that can be gained just from parsing file names, not tucking into the tar entries that contain more extensive metadata.

Fields

name: Stringarch: Option<String>

Methods

impl PkgSpec[src]

pub fn split_specifier(specifier: &str) -> Option<PkgSpec>[src]

Parse a package specifier. None is returned if the provided string is not a valid specifier. Any of the following are valid: pacman-5.1.1-2, pacman-5.1.1-2/, or pacman-5.1.1-2/desc (trailing paths are removed).

pub fn split_pkgname(name: &str) -> Option<PkgSpec>[src]

Parse a full package name, such as pacman-5.1.1-2-x86_64 This is similar to split_specifier, except it does not accept trailing paths, and includes an architecture specifier on the backend.

pub fn version_str(&self) -> String[src]

Trait Implementations

impl Debug for PkgSpec[src]

Auto Trait Implementations

impl Unpin for PkgSpec

impl Sync for PkgSpec

impl Send for PkgSpec

impl UnwindSafe for PkgSpec

impl RefUnwindSafe for PkgSpec

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]