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<'a>(input: &mut Input<'a>) -> PResult<'a, Self>
fn parser<'a>(input: &mut Input<'a>) -> PResult<'a, Self>
Recognizes a PackageRelease in a string slice.
§Errors
Returns an error if input does not begin with a valid PackageRelease.
Source§fn delimiter_error_context<'a, O, P>(
parser: P,
) -> impl Parser<Input<'a>, O, ErrMode<ParseStack<'a>>>where
P: Parser<Input<'a>, O, ErrMode<ParseStack<'a>>>,
fn delimiter_error_context<'a, O, P>(
parser: P,
) -> impl Parser<Input<'a>, O, ErrMode<ParseStack<'a>>>where
P: Parser<Input<'a>, O, ErrMode<ParseStack<'a>>>,
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
impl Eq 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§impl PartialOrd for PackageRelease
impl PartialOrd for PackageRelease
Source§impl Serialize for PackageRelease
impl Serialize 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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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<LocatingSlice<&'a str>, U, ErrMode<ParseStack<'a>>>
fn parser_until<'a, P>( delimiter: P, ) -> impl Parser<LocatingSlice<&'a str>, U, ErrMode<ParseStack<'a>>>
Returns a [Parser] that parses Self until the given delimiter parser
matches.
Source§fn parser_until_eof<'a>(
input: &mut LocatingSlice<&'a str>,
) -> Result<Self, ErrMode<ParseStack<'a>>>
fn parser_until_eof<'a>( input: &mut LocatingSlice<&'a str>, ) -> Result<Self, ErrMode<ParseStack<'a>>>
Source§fn parser_until_line_ending<'a>(
input: &mut LocatingSlice<&'a str>,
) -> Result<Self, ErrMode<ParseStack<'a>>>
fn parser_until_line_ending<'a>( input: &mut LocatingSlice<&'a str>, ) -> Result<Self, ErrMode<ParseStack<'a>>>
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<LocatingSlice<&'a str>, U, ErrMode<ParseStack<'a>>>
fn parser_until_inclusive<'a, P>( delimiter: P, ) -> impl Parser<LocatingSlice<&'a str>, U, ErrMode<ParseStack<'a>>>
Returns a [Parser] that parses the whole input and consumes the given delimiter parser.
Delegates to ParserUntil::parser_until and consumes the delimiter.
Source§fn parser_until_line_ending_inclusive<'a>(
input: &mut LocatingSlice<&'a str>,
) -> Result<Self, ErrMode<ParseStack<'a>>>
fn parser_until_line_ending_inclusive<'a>( input: &mut LocatingSlice<&'a str>, ) -> Result<Self, ErrMode<ParseStack<'a>>>
Parser] that parses until the end of line and fully consumes it. Read more