Struct fuchsia_url::AbsoluteComponentUrl
source · pub struct AbsoluteComponentUrl { /* private fields */ }
Expand description
A URL locating a Fuchsia component.
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
- “resource” is a valid resource path https://fuchsia.dev/fuchsia-src/concepts/packages/package_url
Implementations§
source§impl AbsoluteComponentUrl
impl AbsoluteComponentUrl
sourcepub fn new(
repo: RepositoryUrl,
name: PackageName,
variant: Option<PackageVariant>,
hash: Option<Hash>,
resource: String
) -> Result<Self, ParseError>
pub fn new( repo: RepositoryUrl, name: PackageName, variant: Option<PackageVariant>, hash: Option<Hash>, resource: String ) -> Result<Self, ParseError>
Create an AbsoluteComponentUrl from its component parts.
sourcepub fn parse(url: &str) -> Result<Self, ParseError>
pub fn parse(url: &str) -> Result<Self, ParseError>
Parse a “fuchsia-pkg://” URL that locates a component.
sourcepub fn from_package_url_and_resource(
package: AbsolutePackageUrl,
resource: String
) -> Result<Self, ParseError>
pub fn from_package_url_and_resource( package: AbsolutePackageUrl, resource: String ) -> Result<Self, ParseError>
Create an AbsoluteComponentUrl
from a package URL and a resource path.
sourcepub fn package_url(&self) -> &AbsolutePackageUrl
pub fn package_url(&self) -> &AbsolutePackageUrl
The package URL of this URL (this URL without the resource path).
Methods from Deref<Target = AbsolutePackageUrl>§
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 AbsoluteComponentUrl
impl Clone for AbsoluteComponentUrl
source§fn clone(&self) -> AbsoluteComponentUrl
fn clone(&self) -> AbsoluteComponentUrl
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 AbsoluteComponentUrl
impl Debug for AbsoluteComponentUrl
source§impl Deref for AbsoluteComponentUrl
impl Deref for AbsoluteComponentUrl
source§impl DerefMut for AbsoluteComponentUrl
impl DerefMut for AbsoluteComponentUrl
source§impl<'de> Deserialize<'de> for AbsoluteComponentUrl
impl<'de> Deserialize<'de> for AbsoluteComponentUrl
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 AbsoluteComponentUrl
impl Display for AbsoluteComponentUrl
source§impl FromStr for AbsoluteComponentUrl
impl FromStr for AbsoluteComponentUrl
source§impl Hash for AbsoluteComponentUrl
impl Hash for AbsoluteComponentUrl
source§impl Ord for AbsoluteComponentUrl
impl Ord for AbsoluteComponentUrl
source§fn cmp(&self, other: &AbsoluteComponentUrl) -> Ordering
fn cmp(&self, other: &AbsoluteComponentUrl) -> 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<AbsoluteComponentUrl> for AbsoluteComponentUrl
impl PartialEq<AbsoluteComponentUrl> for AbsoluteComponentUrl
source§fn eq(&self, other: &AbsoluteComponentUrl) -> bool
fn eq(&self, other: &AbsoluteComponentUrl) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<AbsoluteComponentUrl> for AbsoluteComponentUrl
impl PartialOrd<AbsoluteComponentUrl> for AbsoluteComponentUrl
source§fn partial_cmp(&self, other: &AbsoluteComponentUrl) -> Option<Ordering>
fn partial_cmp(&self, other: &AbsoluteComponentUrl) -> 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