pub enum ComponentDependency {
Version(String),
Package {
version: String,
registry: Option<String>,
package: Option<String>,
export: Option<String>,
},
Local {
path: PathBuf,
export: Option<String>,
},
HTTP {
url: String,
digest: String,
export: Option<String>,
},
AppComponent {
component: KebabId,
export: Option<String>,
},
}Expand description
Specifies how to satisfy an import dependency of the component. This may be one of:
- A semantic versioning constraint for the package version to use. Spin fetches the latest matching version of the package whose name matches the dependency name from the default registry.
Example: "my:dep/import" = ">= 0.1.0"
- A package from a registry.
Example: "my:dep/import" = { version = "0.1.0", registry = "registry.io", ...}
- A package from a filesystem path.
Example: "my:dependency" = { path = "path/to/component.wasm", export = "my-export" }
- A component in the application. The referenced component binary is composed: additional
configuration such as files, networking, storage, etc. are ignored. This is intended
primarily as a convenience for including dependencies in the manifest so that they
can be built using
spin build.
Example: "my:dependency" = { component = "my-dependency", export = "my-export" }
- A package from an HTTP URL.
Example: "my:import" = { url = "https://example.com/component.wasm", sha256 = "sha256:..." }
Learn more: https://spinframework.dev/v3/writing-apps#using-component-dependencies
Variants§
Version(String)
... = ">= 0.1.0"
Package
... = { version = "0.1.0", registry = "registry.io", ...}
Fields
version: StringA semantic versioning constraint for the package version to use. Required. Spin fetches the latest matching version from the specified registry, or from the default registry if no registry is specified.
Example: "my:dep/import" = { version = ">= 0.1.0" }
Learn more: https://spinframework.dev/writing-apps#dependencies-from-a-registry
registry: Option<String>The registry that hosts the package. If omitted, this defaults to your system default registry.
Example: "my:dep/import" = { registry = "registry.io", version = " 0.1.0" }
Learn more: https://spinframework.dev/writing-apps#dependencies-from-a-registry
Local
... = { path = "path/to/component.wasm", export = "my-export" }
Fields
HTTP
... = { url = "https://example.com/component.wasm", sha256 = "..." }
Fields
url: StringThe URL to the Wasm component that implements the dependency.
Example: "my:dep/import" = { url = "https://example.com/component.wasm", sha256 = "sha256:..." }
Learn more: https://spinframework.dev/writing-apps#dependencies-from-a-url
AppComponent
... = { component = "my-dependency" }
Trait Implementations§
Source§impl Clone for ComponentDependency
impl Clone for ComponentDependency
Source§fn clone(&self) -> ComponentDependency
fn clone(&self) -> ComponentDependency
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ComponentDependency
impl Debug for ComponentDependency
Source§impl<'de> Deserialize<'de> for ComponentDependency
impl<'de> Deserialize<'de> for ComponentDependency
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>,
Source§impl JsonSchema for ComponentDependency
impl JsonSchema for ComponentDependency
Source§fn schema_name() -> String
fn schema_name() -> String
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref keyword. Read more