Struct packageurl::PackageUrl [−][src]
pub struct PackageUrl<'a> { pub ty: Cow<'a, str>, pub namespace: Option<Cow<'a, str>>, pub name: Cow<'a, str>, pub version: Option<Cow<'a, str>>, pub qualifiers: HashMap<Cow<'a, str>, Cow<'a, str>>, pub subpath: Option<Cow<'a, str>>, }
A Package URL.
Fields
ty: Cow<'a, str>
The package URL type.
namespace: Option<Cow<'a, str>>
The optional namespace
name: Cow<'a, str>
The package name.
version: Option<Cow<'a, str>>
The optional package version.
qualifiers: HashMap<Cow<'a, str>, Cow<'a, str>>
The package qualifiers.
subpath: Option<Cow<'a, str>>
The package subpath.
Methods
impl<'a> PackageUrl<'a>
[src]
impl<'a> PackageUrl<'a>
pub fn new<T, N>(ty: T, name: N) -> Self where
T: Into<Cow<'a, str>>,
N: Into<Cow<'a, str>>,
[src]
pub fn new<T, N>(ty: T, name: N) -> Self where
T: Into<Cow<'a, str>>,
N: Into<Cow<'a, str>>,
Create a new Package URL with the provided type and name.
pub fn with_namespace<N>(&mut self, namespace: N) -> &mut Self where
N: Into<Cow<'a, str>>,
[src]
pub fn with_namespace<N>(&mut self, namespace: N) -> &mut Self where
N: Into<Cow<'a, str>>,
Assign a namespace to the package.
pub fn with_version<V>(&mut self, version: V) -> &mut Self where
V: Into<Cow<'a, str>>,
[src]
pub fn with_version<V>(&mut self, version: V) -> &mut Self where
V: Into<Cow<'a, str>>,
Assign a version to the package.
pub fn with_subpath<S>(&mut self, subpath: S) -> &mut Self where
S: Into<Cow<'a, str>>,
[src]
pub fn with_subpath<S>(&mut self, subpath: S) -> &mut Self where
S: Into<Cow<'a, str>>,
Assign a subpath to the package.
pub fn add_qualifier<K, V>(&mut self, key: K, value: V) -> &mut Self where
K: Into<Cow<'a, str>>,
V: Into<Cow<'a, str>>,
[src]
pub fn add_qualifier<K, V>(&mut self, key: K, value: V) -> &mut Self where
K: Into<Cow<'a, str>>,
V: Into<Cow<'a, str>>,
Add a qualifier to the package.
Trait Implementations
impl<'a> Debug for PackageUrl<'a>
[src]
impl<'a> Debug for PackageUrl<'a>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<'a> Clone for PackageUrl<'a>
[src]
impl<'a> Clone for PackageUrl<'a>
fn clone(&self) -> PackageUrl<'a>
[src]
fn clone(&self) -> PackageUrl<'a>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl FromStr for PackageUrl<'static>
[src]
impl FromStr for PackageUrl<'static>
type Err = Error
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Self>
[src]
fn from_str(s: &str) -> Result<Self>
Parses a string s
to return a value of this type. Read more
impl<'a> ToString for PackageUrl<'a>
[src]
impl<'a> ToString for PackageUrl<'a>
Auto Trait Implementations
impl<'a> Send for PackageUrl<'a>
impl<'a> Send for PackageUrl<'a>
impl<'a> Sync for PackageUrl<'a>
impl<'a> Sync for PackageUrl<'a>