pub enum TriggerDependency {
Package {
version: String,
registry: Option<String>,
package: String,
inherit_configuration: Option<InheritConfiguration>,
},
Local {
path: PathBuf,
inherit_configuration: Option<InheritConfiguration>,
},
HTTP {
url: String,
digest: String,
inherit_configuration: Option<InheritConfiguration>,
},
AppComponent {
component: KebabId,
inherit_configuration: Option<InheritConfiguration>,
},
}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§
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
package: StringThe name of the package to use. If omitted, this defaults to the package name of the imported interface.
Example: "my:dep/import" = { package = "your:implementation", version = "0.1.0" }
Learn more: https://spinframework.dev/writing-apps#dependencies-from-a-registry
inherit_configuration: Option<InheritConfiguration>The set of configurations to inherit from the parent component. If omitted or set to false,
no configurations will be inherited. If true, all configurations will be inherited.
Selective inheritance can be specified by enumerating the configuration keys the dependency
would like to inherit.
Examples:
"my:dep/import" = { version = "0.1.0", inherit_configuration = true }
"my:dep/import" = { version = "0.1.0", inherit_configuration = ["ai_models", "allowed_outbound_hosts"] }
Local
... = { path = "path/to/component.wasm", export = "my-export" }
Fields
path: PathBufThe path to the Wasm file that implements the dependency.
Example: "my:dep/import" = { path = "path/to/component.wasm" }
Learn more: https://spinframework.dev/writing-apps#dependencies-from-a-local-component
inherit_configuration: Option<InheritConfiguration>The set of configurations to inherit from the parent component. If omitted or set to false,
no configurations will be inherited. If true, all configurations will be inherited.
Selective inheritance can be specified by enumerating the configuration keys the dependency
would like to inherit.
Examples:
"my:dep/import" = { version = "0.1.0", inherit_configuration = true }
"my:dep/import" = { version = "0.1.0", inherit_configuration = ["ai_models", "allowed_outbound_hosts"] }
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
digest: StringThe SHA256 digest of the Wasm file. This is required for integrity checking. Must begin with sha256:.
Example: "my:dep/import" = { sha256 = "sha256:...", ... }
Learn more: https://spinframework.dev/writing-apps#dependencies-from-a-url
inherit_configuration: Option<InheritConfiguration>The set of configurations to inherit from the parent component. If omitted or set to false,
no configurations will be inherited. If true, all configurations will be inherited.
Selective inheritance can be specified by enumerating the configuration keys the dependency
would like to inherit.
Examples:
"my:dep/import" = { version = "0.1.0", inherit_configuration = true }
"my:dep/import" = { version = "0.1.0", inherit_configuration = ["ai_models", "allowed_outbound_hosts"] }
AppComponent
... = { component = "my-dependency" }
Fields
component: KebabIdThe ID of the component which implements the dependency.
Example: "my:dep/import" = { component = "my-dependency" }
Learn more: https://spinframework.dev/writing-apps#using-component-dependencies
inherit_configuration: Option<InheritConfiguration>The set of configurations to inherit from the parent component. If omitted or set to false,
no configurations will be inherited. If true, all configurations will be inherited.
Selective inheritance can be specified by enumerating the configuration keys the dependency
would like to inherit.
Examples:
"my:dep/import" = { version = "0.1.0", inherit_configuration = true }
"my:dep/import" = { version = "0.1.0", inherit_configuration = ["ai_models", "allowed_outbound_hosts"] }
Trait Implementations§
Source§impl Clone for TriggerDependency
impl Clone for TriggerDependency
Source§fn clone(&self) -> TriggerDependency
fn clone(&self) -> TriggerDependency
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TriggerDependency
impl Debug for TriggerDependency
Source§impl<'de> Deserialize<'de> for TriggerDependency
impl<'de> Deserialize<'de> for TriggerDependency
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 TriggerDependency
impl JsonSchema for TriggerDependency
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 inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreAuto Trait Implementations§
impl Freeze for TriggerDependency
impl RefUnwindSafe for TriggerDependency
impl Send for TriggerDependency
impl Sync for TriggerDependency
impl Unpin for TriggerDependency
impl UnsafeUnpin for TriggerDependency
impl UnwindSafe for TriggerDependency
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more