pub struct SourceUrl {
pub url: Url,
pub vcs_info: Option<VcsInfo>,
}Expand description
A URL for package sources.
Wraps the Url type and provides optional information on VCS systems.
Can be created from custom URL strings, that in part resemble the default URL syntax, e.g.:
git+https://example.org/example-project.git#tag=v1.0.0?signedThe above example provides an overview of the custom URL syntax:
- The optional VCS specifier
gitis prepended, directly followed by a “+” sign as delimiter, - specific URL
fragmenttypes such astagare used to encode information about the particular VCS objects to address, - the URL
querycomponentsignedis used to indicate that OpenPGP signature verification is required for a VCS type.
§Note
The URL format used by SourceUrl deviates from the default URL syntax by allowing to
change the order of the query and fragment component!
Refer to the alpm-package-source documentation for a more detailed overview of the custom URL syntax.
§Examples
use std::str::FromStr;
use alpm_types::SourceUrl;
// Create Url from &str
let url =
SourceUrl::from_str("git+https://your-vcs.org/example-project.git?signed#tag=v1.0.0")?;
assert_eq!(
&url.to_string(),
"git+https://your-vcs.org/example-project.git?signed#tag=v1.0.0"
);Fields§
§url: UrlThe URL from where the sources are retrieved.
vcs_info: Option<VcsInfo>Optional data on VCS systems using the URL for the retrieval of sources.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for SourceUrl
impl<'de> Deserialize<'de> for SourceUrl
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 FromStr for SourceUrl
impl FromStr for SourceUrl
Source§fn from_str(s: &str) -> Result<Self, Self::Err>
fn from_str(s: &str) -> Result<Self, Self::Err>
Creates a SourceUrl from a string slice.
Delegates to SourceUrl::parser_until.
§Errors
Returns an error if SourceUrl::parser_until fails.
§Examples
use std::str::FromStr;
use alpm_types::SourceUrl;
let url =
SourceUrl::from_str("git+https://your-vcs.org/example-project.git?signed#tag=v1.0.0")?;
assert_eq!(
&url.to_string(),
"git+https://your-vcs.org/example-project.git?signed#tag=v1.0.0"
);Source§impl ParserUntil for SourceUrl
For SourceUrl, we only define a ParserUntil trait and not the AlpmParser trait, as we
don’t provide the Url type parser ourselves. Hence, the indicator for its supposed “end”
must be provided by the caller of the parser.
impl ParserUntil for SourceUrl
For SourceUrl, we only define a ParserUntil trait and not the AlpmParser trait, as we
don’t provide the Url type parser ourselves. Hence, the indicator for its supposed “end”
must be provided by the caller of the parser.
Source§fn parser_until<'a, P>(
delimiter: P,
) -> impl Parser<&'a str, Self, ErrMode<ContextError>>
fn parser_until<'a, P>( delimiter: P, ) -> impl Parser<&'a str, Self, ErrMode<ContextError>>
Source§fn parser_until_eof(input: &mut &str) -> Result<Self, ErrMode<ContextError>>
fn parser_until_eof(input: &mut &str) -> Result<Self, ErrMode<ContextError>>
impl Eq for SourceUrl
impl StructuralPartialEq for SourceUrl
Auto Trait Implementations§
impl Freeze for SourceUrl
impl RefUnwindSafe for SourceUrl
impl Send for SourceUrl
impl Sync for SourceUrl
impl Unpin for SourceUrl
impl UnsafeUnpin for SourceUrl
impl UnwindSafe for SourceUrl
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> 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.