Struct fuchsia_url::UnpinnedAbsolutePackageUrl
source · pub struct UnpinnedAbsolutePackageUrl { /* private fields */ }
Expand description
A URL locating a Fuchsia package. Cannot have a hash.
Has the form “fuchsia-pkg://
- “repository” is a valid hostname
- “name” is a valid package name
- “variant” is an optional valid package variant https://fuchsia.dev/fuchsia-src/concepts/packages/package_url
Implementations§
source§impl UnpinnedAbsolutePackageUrl
impl UnpinnedAbsolutePackageUrl
sourcepub fn new(
repo: RepositoryUrl,
name: PackageName,
variant: Option<PackageVariant>,
) -> Self
pub fn new( repo: RepositoryUrl, name: PackageName, variant: Option<PackageVariant>, ) -> Self
Create an UnpinnedAbsolutePackageUrl from its component parts.
sourcepub fn new_with_path(
repo: RepositoryUrl,
path: &str,
) -> Result<Self, ParseError>
pub fn new_with_path( repo: RepositoryUrl, path: &str, ) -> Result<Self, ParseError>
Create an UnpinnedAbsolutePackageUrl from a RepositoryUrl and a &str path
that will
be validated.
sourcepub fn parse(url: &str) -> Result<Self, ParseError>
pub fn parse(url: &str) -> Result<Self, ParseError>
Parse a “fuchsia-pkg://” URL that locates an unpinned (no hash query parameter) package.
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 UnpinnedAbsolutePackageUrl
impl Clone for UnpinnedAbsolutePackageUrl
source§fn clone(&self) -> UnpinnedAbsolutePackageUrl
fn clone(&self) -> UnpinnedAbsolutePackageUrl
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 UnpinnedAbsolutePackageUrl
impl Debug for UnpinnedAbsolutePackageUrl
source§impl<'de> Deserialize<'de> for UnpinnedAbsolutePackageUrl
impl<'de> Deserialize<'de> for UnpinnedAbsolutePackageUrl
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 UnpinnedAbsolutePackageUrl
impl Display for UnpinnedAbsolutePackageUrl
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 UnpinnedAbsolutePackageUrl
impl FromStr for UnpinnedAbsolutePackageUrl
source§impl Hash for UnpinnedAbsolutePackageUrl
impl Hash for UnpinnedAbsolutePackageUrl
source§impl Ord for UnpinnedAbsolutePackageUrl
impl Ord for UnpinnedAbsolutePackageUrl
source§fn cmp(&self, other: &UnpinnedAbsolutePackageUrl) -> Ordering
fn cmp(&self, other: &UnpinnedAbsolutePackageUrl) -> 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 UnpinnedAbsolutePackageUrl
impl PartialEq for UnpinnedAbsolutePackageUrl
source§fn eq(&self, other: &UnpinnedAbsolutePackageUrl) -> bool
fn eq(&self, other: &UnpinnedAbsolutePackageUrl) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for UnpinnedAbsolutePackageUrl
impl PartialOrd for UnpinnedAbsolutePackageUrl
source§fn partial_cmp(&self, other: &UnpinnedAbsolutePackageUrl) -> Option<Ordering>
fn partial_cmp(&self, other: &UnpinnedAbsolutePackageUrl) -> 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 moresource§impl TryFrom<&str> for UnpinnedAbsolutePackageUrl
impl TryFrom<&str> for UnpinnedAbsolutePackageUrl
source§impl Deref for UnpinnedAbsolutePackageUrl
impl Deref for UnpinnedAbsolutePackageUrl
impl Eq for UnpinnedAbsolutePackageUrl
impl StructuralPartialEq for UnpinnedAbsolutePackageUrl
Auto Trait Implementations§
impl Freeze for UnpinnedAbsolutePackageUrl
impl RefUnwindSafe for UnpinnedAbsolutePackageUrl
impl Send for UnpinnedAbsolutePackageUrl
impl Sync for UnpinnedAbsolutePackageUrl
impl Unpin for UnpinnedAbsolutePackageUrl
impl UnwindSafe for UnpinnedAbsolutePackageUrl
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)