pub struct WebcPackageIdentifierV1 {
pub repository: Option<Url>,
pub namespace: String,
pub name: String,
pub tag: Option<String>,
}Expand description
Parsed representation of a WebC package source.
Fields§
§repository: Option<Url>§namespace: String§name: String§tag: Option<String>Implementations§
source§impl WebcPackageIdentifierV1
impl WebcPackageIdentifierV1
sourcepub fn build_identifier(&self) -> String
pub fn build_identifier(&self) -> String
Build the ident for a package.
Format: NAMESPACE/NAME[@version|hash]
If prefer_hash is true, the ident will use the signature hash instead of the version if both are available.
sourcepub fn build_download_url(&self) -> Option<Url>
pub fn build_download_url(&self) -> Option<Url>
The the url where the webc package can be downloaded.
NOTE: returns Option::None if Self::repository is not set.
Private packages will also require an auth token for downloading.
sourcepub fn build_download_url_with_default_registry(&self, default_reg: &Url) -> Url
pub fn build_download_url_with_default_registry(&self, default_reg: &Url) -> Url
The the url where the webc package can be downloaded.
Private packages will also require an auth token for downloading.
pub fn parse(value: &str) -> Result<Self, WebcParseError>
Trait Implementations§
source§impl Clone for WebcPackageIdentifierV1
impl Clone for WebcPackageIdentifierV1
source§fn clone(&self) -> WebcPackageIdentifierV1
fn clone(&self) -> WebcPackageIdentifierV1
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 WebcPackageIdentifierV1
impl Debug for WebcPackageIdentifierV1
source§impl<'de> Deserialize<'de> for WebcPackageIdentifierV1
impl<'de> Deserialize<'de> for WebcPackageIdentifierV1
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Display for WebcPackageIdentifierV1
impl Display for WebcPackageIdentifierV1
source§impl From<StringWebcPackageIdent> for WebcPackageIdentifierV1
impl From<StringWebcPackageIdent> for WebcPackageIdentifierV1
source§fn from(x: StringWebcPackageIdent) -> Self
fn from(x: StringWebcPackageIdent) -> Self
Converts to this type from the input type.
source§impl JsonSchema for WebcPackageIdentifierV1
impl JsonSchema for WebcPackageIdentifierV1
source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
source§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref keyword. Read moresource§impl PartialEq<WebcPackageIdentifierV1> for WebcPackageIdentifierV1
impl PartialEq<WebcPackageIdentifierV1> for WebcPackageIdentifierV1
source§fn eq(&self, other: &WebcPackageIdentifierV1) -> bool
fn eq(&self, other: &WebcPackageIdentifierV1) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl Serialize for WebcPackageIdentifierV1
impl Serialize for WebcPackageIdentifierV1
impl Eq for WebcPackageIdentifierV1
impl StructuralEq for WebcPackageIdentifierV1
impl StructuralPartialEq for WebcPackageIdentifierV1
Auto Trait Implementations§
impl RefUnwindSafe for WebcPackageIdentifierV1
impl Send for WebcPackageIdentifierV1
impl Sync for WebcPackageIdentifierV1
impl Unpin for WebcPackageIdentifierV1
impl UnwindSafe for WebcPackageIdentifierV1
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<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.