pub struct PackageRelease {
pub major: usize,
pub minor: Option<usize>,
}Expand description
The release version of a package.
A PackageRelease wraps a usize for its major version and an optional usize for its
minor version.
PackageRelease is used to indicate the build version of a package.
It is mostly useful in conjunction with a PackageVersion (see Version).
Refer to alpm-pkgrel for more details on the format.
§Examples
use std::str::FromStr;
use alpm_types::PackageRelease;
assert!(PackageRelease::from_str("1").is_ok());
assert!(PackageRelease::from_str("1.1").is_ok());
assert!(PackageRelease::from_str("0").is_ok());
assert!(PackageRelease::from_str("a").is_err());
assert!(PackageRelease::from_str("1.a").is_err());Fields§
§major: usizeThe major version of this package release.
minor: Option<usize>The optional minor version of this package release.
Implementations§
Trait Implementations§
Source§impl AlpmParser for PackageRelease
impl AlpmParser for PackageRelease
Source§fn parser(input: &mut &str) -> ModalResult<Self>
fn parser(input: &mut &str) -> ModalResult<Self>
Recognizes a PackageRelease in a string slice.
§Errors
Returns an error if input does not begin with a valid PackageRelease.
Source§impl Clone for PackageRelease
impl Clone for PackageRelease
Source§fn clone(&self) -> PackageRelease
fn clone(&self) -> PackageRelease
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PackageRelease
impl Debug for PackageRelease
Source§impl<'de> Deserialize<'de> for PackageRelease
impl<'de> Deserialize<'de> for PackageRelease
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for PackageRelease
impl Display for PackageRelease
Source§impl FromStr for PackageRelease
impl FromStr for PackageRelease
Source§fn from_str(s: &str) -> Result<Self, Self::Err>
fn from_str(s: &str) -> Result<Self, Self::Err>
Creates a PackageRelease from a string slice.
Delegates to PackageRelease::parser.
§Errors
Returns an error if PackageRelease::parser fails.
Source§impl Ord for PackageRelease
impl Ord for PackageRelease
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for PackageRelease
impl PartialEq for PackageRelease
Source§fn eq(&self, other: &PackageRelease) -> bool
fn eq(&self, other: &PackageRelease) -> bool
self and other values to be equal, and is used by ==.Source§impl PartialOrd for PackageRelease
impl PartialOrd for PackageRelease
Source§impl Serialize for PackageRelease
impl Serialize for PackageRelease
impl Eq for PackageRelease
impl StructuralPartialEq for PackageRelease
Auto Trait Implementations§
impl Freeze for PackageRelease
impl RefUnwindSafe for PackageRelease
impl Send for PackageRelease
impl Sync for PackageRelease
impl Unpin for PackageRelease
impl UnsafeUnpin for PackageRelease
impl UnwindSafe for PackageRelease
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for T
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<U> ParserUntil for Uwhere
U: AlpmParser,
impl<U> ParserUntil for Uwhere
U: AlpmParser,
Source§fn parser_until<'a, P>(
delimiter: P,
) -> impl Parser<&'a str, U, ErrMode<ContextError>>
fn parser_until<'a, P>( delimiter: P, ) -> impl Parser<&'a str, U, ErrMode<ContextError>>
Returns a [Parser] that parses Self until the given delimiter parser
matches.
§Note
Does not consume the delimiter.
Source§fn parser_until_eof(input: &mut &str) -> Result<Self, ErrMode<ContextError>>
fn parser_until_eof(input: &mut &str) -> Result<Self, ErrMode<ContextError>>
Source§impl<U> ParserUntilInclusive for Uwhere
U: ParserUntil,
impl<U> ParserUntilInclusive for Uwhere
U: ParserUntil,
Source§fn parser_until_inclusive<'a, P>(
delimiter: P,
) -> impl Parser<&'a str, U, ErrMode<ContextError>>
fn parser_until_inclusive<'a, P>( delimiter: P, ) -> impl Parser<&'a str, U, ErrMode<ContextError>>
Returns a [Parser] that parses the whole input and consumes the given delimiter parser.
Delegates to ParserUntil::parser_until and consumes the delimiter.