Struct fuchsia_url::PinnedAbsolutePackageUrl
source · pub struct PinnedAbsolutePackageUrl { /* private fields */ }
Expand description
A URL locating a Fuchsia package. Must 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
- “hash” is a valid package hash https://fuchsia.dev/fuchsia-src/concepts/packages/package_url
Implementations§
source§impl PinnedAbsolutePackageUrl
impl PinnedAbsolutePackageUrl
sourcepub fn new(
repo: RepositoryUrl,
name: PackageName,
variant: Option<PackageVariant>,
hash: Hash,
) -> Self
pub fn new( repo: RepositoryUrl, name: PackageName, variant: Option<PackageVariant>, hash: Hash, ) -> Self
Create a PinnedAbsolutePackageUrl
from its component parts.
sourcepub fn new_with_path(
repo: RepositoryUrl,
path: &str,
hash: Hash,
) -> Result<Self, ParseError>
pub fn new_with_path( repo: RepositoryUrl, path: &str, hash: Hash, ) -> Result<Self, ParseError>
Create a PinnedAbsolutePackageUrl from its component parts 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 a pinned (has a hash query parameter) package.
sourcepub fn from_unpinned(unpinned: UnpinnedAbsolutePackageUrl, hash: Hash) -> Self
pub fn from_unpinned(unpinned: UnpinnedAbsolutePackageUrl, hash: Hash) -> Self
Create a PinnedAbsolutePackageUrl
from an unpinned url and a hash.
sourcepub fn into_unpinned_and_hash(self) -> (UnpinnedAbsolutePackageUrl, Hash)
pub fn into_unpinned_and_hash(self) -> (UnpinnedAbsolutePackageUrl, Hash)
Split this URL into an unpinned URL and hash.
sourcepub fn as_unpinned(&self) -> &UnpinnedAbsolutePackageUrl
pub fn as_unpinned(&self) -> &UnpinnedAbsolutePackageUrl
The URL without the hash.
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
.
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 PinnedAbsolutePackageUrl
impl Clone for PinnedAbsolutePackageUrl
source§fn clone(&self) -> PinnedAbsolutePackageUrl
fn clone(&self) -> PinnedAbsolutePackageUrl
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 PinnedAbsolutePackageUrl
impl Debug for PinnedAbsolutePackageUrl
source§impl DerefMut for PinnedAbsolutePackageUrl
impl DerefMut for PinnedAbsolutePackageUrl
source§impl<'de> Deserialize<'de> for PinnedAbsolutePackageUrl
impl<'de> Deserialize<'de> for PinnedAbsolutePackageUrl
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 PinnedAbsolutePackageUrl
impl Display for PinnedAbsolutePackageUrl
source§impl From<PinnedAbsolutePackageUrl> for AbsolutePackageUrl
impl From<PinnedAbsolutePackageUrl> for AbsolutePackageUrl
source§fn from(pinned: PinnedAbsolutePackageUrl) -> Self
fn from(pinned: PinnedAbsolutePackageUrl) -> Self
Converts to this type from the input type.
source§impl FromStr for PinnedAbsolutePackageUrl
impl FromStr for PinnedAbsolutePackageUrl
source§impl Hash for PinnedAbsolutePackageUrl
impl Hash for PinnedAbsolutePackageUrl
source§impl Ord for PinnedAbsolutePackageUrl
impl Ord for PinnedAbsolutePackageUrl
source§fn cmp(&self, other: &PinnedAbsolutePackageUrl) -> Ordering
fn cmp(&self, other: &PinnedAbsolutePackageUrl) -> 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 PinnedAbsolutePackageUrl
impl PartialEq for PinnedAbsolutePackageUrl
source§fn eq(&self, other: &PinnedAbsolutePackageUrl) -> bool
fn eq(&self, other: &PinnedAbsolutePackageUrl) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for PinnedAbsolutePackageUrl
impl PartialOrd for PinnedAbsolutePackageUrl
source§fn partial_cmp(&self, other: &PinnedAbsolutePackageUrl) -> Option<Ordering>
fn partial_cmp(&self, other: &PinnedAbsolutePackageUrl) -> 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 Serialize for PinnedAbsolutePackageUrl
impl Serialize for PinnedAbsolutePackageUrl
source§impl TryFrom<&str> for PinnedAbsolutePackageUrl
impl TryFrom<&str> for PinnedAbsolutePackageUrl
source§impl Deref for PinnedAbsolutePackageUrl
impl Deref for PinnedAbsolutePackageUrl
impl Eq for PinnedAbsolutePackageUrl
impl StructuralPartialEq for PinnedAbsolutePackageUrl
Auto Trait Implementations§
impl Freeze for PinnedAbsolutePackageUrl
impl RefUnwindSafe for PinnedAbsolutePackageUrl
impl Send for PinnedAbsolutePackageUrl
impl Sync for PinnedAbsolutePackageUrl
impl Unpin for PinnedAbsolutePackageUrl
impl UnwindSafe for PinnedAbsolutePackageUrl
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
)