pub enum RelationOrSoname {
Relation(PackageRelation),
SonameV1(SonameV1),
SonameV2(SonameV2),
}Expand description
Provides either a PackageRelation, a SonameV1 or a SonameV2.
This enum is used for alpm-package-relations of type run-time dependency and provision e.g. in PKGINFO, SRCINFO or alpm-db-desc files.
Variants§
Relation(PackageRelation)
A package relation (as PackageRelation).
SonameV1(SonameV1)
A shared object name following alpm-sonamev1.
SonameV2(SonameV2)
A shared object name following alpm-sonamev2.
Trait Implementations§
Source§impl Clone for RelationOrSoname
impl Clone for RelationOrSoname
Source§fn clone(&self) -> RelationOrSoname
fn clone(&self) -> RelationOrSoname
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RelationOrSoname
impl Debug for RelationOrSoname
Source§impl<'de> Deserialize<'de> for RelationOrSoname
impl<'de> Deserialize<'de> for RelationOrSoname
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for RelationOrSoname
impl Display for RelationOrSoname
impl Eq for RelationOrSoname
Source§impl FromStr for RelationOrSoname
impl FromStr for RelationOrSoname
Source§fn from_str(s: &str) -> Result<Self, Self::Err>
fn from_str(s: &str) -> Result<Self, Self::Err>
Creates a RelationOrSoname from a string slice.
Relies on RelationOrSoname::parser_until_eof to recognize types in input and create a
RelationOrSoname accordingly.
§Errors
Returns an error if no RelationOrSoname can be created from input.
§Examples
use alpm_types::{PackageRelation, RelationOrSoname, SonameV1, SonameV2};
let relation: RelationOrSoname = "example=1.0.0".parse()?;
assert_eq!(
relation,
RelationOrSoname::Relation(PackageRelation::new(
"example".parse()?,
Some("=1.0.0".parse()?)
))
);
let sonamev2: RelationOrSoname = "lib:example.so.1".parse()?;
assert_eq!(
sonamev2,
RelationOrSoname::SonameV2(SonameV2::new("lib".parse()?, "example.so.1".parse()?))
);
let sonamev1: RelationOrSoname = "example.so".parse()?;
assert_eq!(
sonamev1,
RelationOrSoname::SonameV1(SonameV1::new("example.so".parse()?, None, None)?)
);Source§impl ParserUntil for RelationOrSoname
impl ParserUntil for RelationOrSoname
Source§fn parser_until<'a, P>(
delimiter: P,
) -> impl Parser<Input<'a>, Self, ErrMode<ParseStack<'a>>>
fn parser_until<'a, P>( delimiter: P, ) -> impl Parser<Input<'a>, Self, ErrMode<ParseStack<'a>>>
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 PartialEq for RelationOrSoname
impl PartialEq for RelationOrSoname
Source§impl PartialEq<PackageRelation> for RelationOrSoname
impl PartialEq<PackageRelation> for RelationOrSoname
Source§impl PartialEq<SonameV1> for RelationOrSoname
impl PartialEq<SonameV1> for RelationOrSoname
Source§impl PartialEq<SonameV2> for RelationOrSoname
impl PartialEq<SonameV2> for RelationOrSoname
Source§impl Serialize for RelationOrSoname
impl Serialize for RelationOrSoname
impl StructuralPartialEq for RelationOrSoname
Auto Trait Implementations§
impl Freeze for RelationOrSoname
impl RefUnwindSafe for RelationOrSoname
impl Send for RelationOrSoname
impl Sync for RelationOrSoname
impl Unpin for RelationOrSoname
impl UnsafeUnpin for RelationOrSoname
impl UnwindSafe for RelationOrSoname
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
Mutably borrows from an owned value. Read more
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> 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>>>
Returns a [
Parser] that parses until the end of line and fully consumes it. Read more