pub struct PkgSpec {
pub name: String,
pub arch: Option<String>,
/* private fields */
}Expand description
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: String§arch: Option<String>Implementations§
Source§impl PkgSpec
impl PkgSpec
Sourcepub fn split_specifier(specifier: &str) -> Option<PkgSpec>
pub fn split_specifier(specifier: &str) -> Option<PkgSpec>
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).
Sourcepub fn split_pkgname(name: &str) -> Option<PkgSpec>
pub fn split_pkgname(name: &str) -> Option<PkgSpec>
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
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PkgSpec
impl RefUnwindSafe for PkgSpec
impl Send for PkgSpec
impl Sync for PkgSpec
impl Unpin for PkgSpec
impl UnwindSafe for PkgSpec
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more