Struct edge_schema::schema::WebcIdent
source · pub struct WebcIdent {
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 WebcIdent
impl WebcIdent
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<'de> Deserialize<'de> for WebcIdent
impl<'de> Deserialize<'de> for WebcIdent
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 From<StringWebcIdent> for WebcIdent
impl From<StringWebcIdent> for WebcIdent
source§fn from(x: StringWebcIdent) -> Self
fn from(x: StringWebcIdent) -> Self
Converts to this type from the input type.
source§impl From<WebcIdent> for StringWebcIdent
impl From<WebcIdent> for StringWebcIdent
source§impl JsonSchema for WebcIdent
impl JsonSchema for WebcIdent
source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. 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 for WebcIdent
impl PartialEq for WebcIdent
impl Eq for WebcIdent
impl StructuralPartialEq for WebcIdent
Auto Trait Implementations§
impl Freeze for WebcIdent
impl RefUnwindSafe for WebcIdent
impl Send for WebcIdent
impl Sync for WebcIdent
impl Unpin for WebcIdent
impl UnwindSafe for WebcIdent
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 Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.