Enum fuchsia_url::AbsolutePackageUrl
source · pub enum AbsolutePackageUrl {
Unpinned(UnpinnedAbsolutePackageUrl),
Pinned(PinnedAbsolutePackageUrl),
}
Expand description
A URL locating a Fuchsia package.
Has the form “fuchsia-pkg://
- “repository” is a valid hostname
- “name” is a valid package name
- “variant” is an optional valid package variant
- “hash” is an optional valid package hash https://fuchsia.dev/fuchsia-src/concepts/packages/package_url
Variants§
Unpinned(UnpinnedAbsolutePackageUrl)
Pinned(PinnedAbsolutePackageUrl)
Implementations§
source§impl AbsolutePackageUrl
impl AbsolutePackageUrl
sourcepub fn parse(url: &str) -> Result<Self, ParseError>
pub fn parse(url: &str) -> Result<Self, ParseError>
Parse a “fuchsia-pkg://” URL that locates an optionally pinned package.
sourcepub fn new_with_path(
repo: RepositoryUrl,
path: &str,
hash: Option<Hash>
) -> Result<Self, ParseError>
pub fn new_with_path( repo: RepositoryUrl, path: &str, hash: Option<Hash> ) -> Result<Self, ParseError>
Create an AbsolutePackageUrl from its component parts and a &str path
that will be
validated.
sourcepub fn new(
repo: RepositoryUrl,
name: PackageName,
variant: Option<PackageVariant>,
hash: Option<Hash>
) -> Self
pub fn new( repo: RepositoryUrl, name: PackageName, variant: Option<PackageVariant>, hash: Option<Hash> ) -> Self
Create an AbsolutePackageUrl from its component parts.
sourcepub fn as_unpinned(&self) -> &UnpinnedAbsolutePackageUrl
pub fn as_unpinned(&self) -> &UnpinnedAbsolutePackageUrl
The URL without the optional package hash.
Methods from Deref<Target = UnpinnedAbsolutePackageUrl>§
sourcepub fn repository(&self) -> &RepositoryUrl
pub fn repository(&self) -> &RepositoryUrl
The Repository URL behind this URL (this URL without the path).
sourcepub fn name(&self) -> &PackageName
pub fn name(&self) -> &PackageName
The package name.
sourcepub fn variant(&self) -> Option<&PackageVariant>
pub fn variant(&self) -> Option<&PackageVariant>
The optional package variant.
sourcepub fn set_repository(&mut self, repository: RepositoryUrl) -> &mut Self
pub fn set_repository(&mut self, repository: RepositoryUrl) -> &mut Self
Change the repository to repository
.
sourcepub fn clear_variant(&mut self) -> &mut Self
pub fn clear_variant(&mut self) -> &mut Self
Clear the variant if there is one.
Methods from Deref<Target = RepositoryUrl>§
Trait Implementations§
source§impl Clone for AbsolutePackageUrl
impl Clone for AbsolutePackageUrl
source§fn clone(&self) -> AbsolutePackageUrl
fn clone(&self) -> AbsolutePackageUrl
Returns a copy of the value. Read more
1.0.0 · 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 AbsolutePackageUrl
impl Debug for AbsolutePackageUrl
source§impl Deref for AbsolutePackageUrl
impl Deref for AbsolutePackageUrl
source§impl DerefMut for AbsolutePackageUrl
impl DerefMut for AbsolutePackageUrl
source§impl<'de> Deserialize<'de> for AbsolutePackageUrl
impl<'de> Deserialize<'de> for AbsolutePackageUrl
source§fn deserialize<D>(de: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(de: D) -> Result<Self, D::Error>where D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Display for AbsolutePackageUrl
impl Display for AbsolutePackageUrl
source§impl From<AbsolutePackageUrl> for PackageUrl
impl From<AbsolutePackageUrl> for PackageUrl
source§fn from(absolute: AbsolutePackageUrl) -> Self
fn from(absolute: AbsolutePackageUrl) -> Self
Converts to this type from the input type.
source§impl From<PinnedAbsolutePackageUrl> for AbsolutePackageUrl
impl From<PinnedAbsolutePackageUrl> for AbsolutePackageUrl
source§fn from(pinned: PinnedAbsolutePackageUrl) -> Self
fn from(pinned: PinnedAbsolutePackageUrl) -> Self
Converts to this type from the input type.
source§impl From<UnpinnedAbsolutePackageUrl> for AbsolutePackageUrl
impl From<UnpinnedAbsolutePackageUrl> for AbsolutePackageUrl
source§fn from(unpinned: UnpinnedAbsolutePackageUrl) -> Self
fn from(unpinned: UnpinnedAbsolutePackageUrl) -> Self
Converts to this type from the input type.
source§impl FromStr for AbsolutePackageUrl
impl FromStr for AbsolutePackageUrl
source§impl Hash for AbsolutePackageUrl
impl Hash for AbsolutePackageUrl
source§impl Ord for AbsolutePackageUrl
impl Ord for AbsolutePackageUrl
source§fn cmp(&self, other: &AbsolutePackageUrl) -> Ordering
fn cmp(&self, other: &AbsolutePackageUrl) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq<AbsolutePackageUrl> for AbsolutePackageUrl
impl PartialEq<AbsolutePackageUrl> for AbsolutePackageUrl
source§fn eq(&self, other: &AbsolutePackageUrl) -> bool
fn eq(&self, other: &AbsolutePackageUrl) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<AbsolutePackageUrl> for AbsolutePackageUrl
impl PartialOrd<AbsolutePackageUrl> for AbsolutePackageUrl
source§fn partial_cmp(&self, other: &AbsolutePackageUrl) -> Option<Ordering>
fn partial_cmp(&self, other: &AbsolutePackageUrl) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read more