pub struct FuchsiaPkgAbsoluteComponentUrl { /* 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 FuchsiaPkgAbsoluteComponentUrl
impl FuchsiaPkgAbsoluteComponentUrl
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 FuchsiaPkgAbsoluteComponentUrl 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: FuchsiaPkgAbsolutePackageUrl,
resource: String,
) -> Result<Self, ParseError>
pub fn from_package_url_and_resource( package: FuchsiaPkgAbsolutePackageUrl, resource: String, ) -> Result<Self, ParseError>
Create an FuchsiaPkgAbsoluteComponentUrl from a package URL and a resource path.
Sourcepub fn package_url(&self) -> &FuchsiaPkgAbsolutePackageUrl
pub fn package_url(&self) -> &FuchsiaPkgAbsolutePackageUrl
The package URL of this URL (this URL without the resource path).
Sourcepub fn into_package_and_resource(
self,
) -> (FuchsiaPkgAbsolutePackageUrl, Resource)
pub fn into_package_and_resource( self, ) -> (FuchsiaPkgAbsolutePackageUrl, Resource)
Split this component URL into a package URL and a resource.
Methods from Deref<Target = FuchsiaPkgAbsolutePackageUrl>§
pub fn name(&self) -> &PackageName
Sourcepub fn as_unpinned(&self) -> &FuchsiaPkgUnpinnedAbsolutePackageUrl
pub fn as_unpinned(&self) -> &FuchsiaPkgUnpinnedAbsolutePackageUrl
The URL without the optional package hash.
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 FuchsiaPkgAbsoluteComponentUrl
impl Clone for FuchsiaPkgAbsoluteComponentUrl
Source§fn clone(&self) -> FuchsiaPkgAbsoluteComponentUrl
fn clone(&self) -> FuchsiaPkgAbsoluteComponentUrl
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<'de> Deserialize<'de> for FuchsiaPkgAbsoluteComponentUrl
impl<'de> Deserialize<'de> for FuchsiaPkgAbsoluteComponentUrl
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 Ord for FuchsiaPkgAbsoluteComponentUrl
impl Ord for FuchsiaPkgAbsoluteComponentUrl
Source§fn cmp(&self, other: &FuchsiaPkgAbsoluteComponentUrl) -> Ordering
fn cmp(&self, other: &FuchsiaPkgAbsoluteComponentUrl) -> 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 FuchsiaPkgAbsoluteComponentUrl
impl PartialEq for FuchsiaPkgAbsoluteComponentUrl
Source§fn eq(&self, other: &FuchsiaPkgAbsoluteComponentUrl) -> bool
fn eq(&self, other: &FuchsiaPkgAbsoluteComponentUrl) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for FuchsiaPkgAbsoluteComponentUrl
impl PartialOrd for FuchsiaPkgAbsoluteComponentUrl
Source§impl TryFrom<&str> for FuchsiaPkgAbsoluteComponentUrl
impl TryFrom<&str> for FuchsiaPkgAbsoluteComponentUrl
impl Eq for FuchsiaPkgAbsoluteComponentUrl
impl StructuralPartialEq for FuchsiaPkgAbsoluteComponentUrl
Auto Trait Implementations§
impl Freeze for FuchsiaPkgAbsoluteComponentUrl
impl RefUnwindSafe for FuchsiaPkgAbsoluteComponentUrl
impl Send for FuchsiaPkgAbsoluteComponentUrl
impl Sync for FuchsiaPkgAbsoluteComponentUrl
impl Unpin for FuchsiaPkgAbsoluteComponentUrl
impl UnwindSafe for FuchsiaPkgAbsoluteComponentUrl
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