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>§
pub fn name(&self) -> &PackageName
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.
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 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 for AbsoluteComponentUrl
impl PartialEq for AbsoluteComponentUrl
Source§impl PartialOrd for AbsoluteComponentUrl
impl PartialOrd for AbsoluteComponentUrl
Source§impl Serialize for AbsoluteComponentUrl
impl Serialize for AbsoluteComponentUrl
Source§impl TryFrom<&AbsoluteComponentUrl> for BootUrl
impl TryFrom<&AbsoluteComponentUrl> for BootUrl
Source§type Error = ParseError
type Error = ParseError
The type returned in the event of a conversion error.
Source§fn try_from(component_url: &AbsoluteComponentUrl) -> Result<Self, ParseError>
fn try_from(component_url: &AbsoluteComponentUrl) -> Result<Self, ParseError>
Performs the conversion.
Source§impl TryFrom<&str> for AbsoluteComponentUrl
impl TryFrom<&str> for AbsoluteComponentUrl
Source§impl Deref for AbsoluteComponentUrl
impl Deref for AbsoluteComponentUrl
impl Eq for AbsoluteComponentUrl
impl StructuralPartialEq for AbsoluteComponentUrl
Auto Trait Implementations§
impl Freeze for AbsoluteComponentUrl
impl RefUnwindSafe for AbsoluteComponentUrl
impl Send for AbsoluteComponentUrl
impl Sync for AbsoluteComponentUrl
impl Unpin for AbsoluteComponentUrl
impl UnwindSafe for AbsoluteComponentUrl
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)