pub enum FuchsiaPkgAbsolutePackageUrl {
Unpinned(FuchsiaPkgUnpinnedAbsolutePackageUrl),
Pinned(FuchsiaPkgPinnedAbsolutePackageUrl),
}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(FuchsiaPkgUnpinnedAbsolutePackageUrl)
Pinned(FuchsiaPkgPinnedAbsolutePackageUrl)
Implementations§
Source§impl FuchsiaPkgAbsolutePackageUrl
impl FuchsiaPkgAbsolutePackageUrl
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.
pub fn from_url(url: &Url) -> Result<Self, ParseError>
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 a FuchsiaPkgAbsolutePackageUrl 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 a FuchsiaPkgAbsolutePackageUrl from its component parts.
pub fn name(&self) -> &PackageName
Sourcepub fn as_unpinned(&self) -> &FuchsiaPkgUnpinnedAbsolutePackageUrl
pub fn as_unpinned(&self) -> &FuchsiaPkgUnpinnedAbsolutePackageUrl
The URL without the optional package hash.
Sourcepub fn pinned(self) -> Option<FuchsiaPkgPinnedAbsolutePackageUrl>
pub fn pinned(self) -> Option<FuchsiaPkgPinnedAbsolutePackageUrl>
The pinned URL, if the URL is pinned.
Methods from Deref<Target = FuchsiaPkgUnpinnedAbsolutePackageUrl>§
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.
Trait Implementations§
Source§impl Clone for FuchsiaPkgAbsolutePackageUrl
impl Clone for FuchsiaPkgAbsolutePackageUrl
Source§fn clone(&self) -> FuchsiaPkgAbsolutePackageUrl
fn clone(&self) -> FuchsiaPkgAbsolutePackageUrl
Returns a duplicate 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 FuchsiaPkgAbsolutePackageUrl
impl Debug for FuchsiaPkgAbsolutePackageUrl
Source§impl Deref for FuchsiaPkgAbsolutePackageUrl
impl Deref for FuchsiaPkgAbsolutePackageUrl
Source§impl<'de> Deserialize<'de> for FuchsiaPkgAbsolutePackageUrl
impl<'de> Deserialize<'de> for FuchsiaPkgAbsolutePackageUrl
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 From<FuchsiaPkgAbsolutePackageUrl> for FuchsiaPkgPackageUrl
impl From<FuchsiaPkgAbsolutePackageUrl> for FuchsiaPkgPackageUrl
Source§fn from(absolute: FuchsiaPkgAbsolutePackageUrl) -> Self
fn from(absolute: FuchsiaPkgAbsolutePackageUrl) -> Self
Converts to this type from the input type.
Source§impl From<FuchsiaPkgPinnedAbsolutePackageUrl> for FuchsiaPkgAbsolutePackageUrl
impl From<FuchsiaPkgPinnedAbsolutePackageUrl> for FuchsiaPkgAbsolutePackageUrl
Source§fn from(pinned: FuchsiaPkgPinnedAbsolutePackageUrl) -> Self
fn from(pinned: FuchsiaPkgPinnedAbsolutePackageUrl) -> Self
Converts to this type from the input type.
Source§impl From<FuchsiaPkgUnpinnedAbsolutePackageUrl> for FuchsiaPkgAbsolutePackageUrl
impl From<FuchsiaPkgUnpinnedAbsolutePackageUrl> for FuchsiaPkgAbsolutePackageUrl
Source§fn from(unpinned: FuchsiaPkgUnpinnedAbsolutePackageUrl) -> Self
fn from(unpinned: FuchsiaPkgUnpinnedAbsolutePackageUrl) -> Self
Converts to this type from the input type.
Source§impl Hash for FuchsiaPkgAbsolutePackageUrl
impl Hash for FuchsiaPkgAbsolutePackageUrl
Source§impl Ord for FuchsiaPkgAbsolutePackageUrl
impl Ord for FuchsiaPkgAbsolutePackageUrl
Source§fn cmp(&self, other: &FuchsiaPkgAbsolutePackageUrl) -> Ordering
fn cmp(&self, other: &FuchsiaPkgAbsolutePackageUrl) -> 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 for FuchsiaPkgAbsolutePackageUrl
impl PartialEq for FuchsiaPkgAbsolutePackageUrl
Source§fn eq(&self, other: &FuchsiaPkgAbsolutePackageUrl) -> bool
fn eq(&self, other: &FuchsiaPkgAbsolutePackageUrl) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for FuchsiaPkgAbsolutePackageUrl
impl PartialOrd for FuchsiaPkgAbsolutePackageUrl
Source§impl TryFrom<&str> for FuchsiaPkgAbsolutePackageUrl
impl TryFrom<&str> for FuchsiaPkgAbsolutePackageUrl
impl Eq for FuchsiaPkgAbsolutePackageUrl
impl StructuralPartialEq for FuchsiaPkgAbsolutePackageUrl
Auto Trait Implementations§
impl Freeze for FuchsiaPkgAbsolutePackageUrl
impl RefUnwindSafe for FuchsiaPkgAbsolutePackageUrl
impl Send for FuchsiaPkgAbsolutePackageUrl
impl Sync for FuchsiaPkgAbsolutePackageUrl
impl Unpin for FuchsiaPkgAbsolutePackageUrl
impl UnwindSafe for FuchsiaPkgAbsolutePackageUrl
Blanket Implementations§
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